git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Kernel/x86_64 - Fixed bugs exposed by -O3
[tpg/acess2.git]
/
Kernel
/
arch
/
x86_64
/
errors.c
diff --git
a/Kernel/arch/x86_64/errors.c
b/Kernel/arch/x86_64/errors.c
index
711846c
..
d1856db
100644
(file)
--- a/
Kernel/arch/x86_64/errors.c
+++ b/
Kernel/arch/x86_64/errors.c
@@
-9,7
+9,7
@@
#define MAX_BACKTRACE 6
// === IMPORTS ===
#define MAX_BACKTRACE 6
// === IMPORTS ===
-
void
MM_PageFault(tVAddr Addr, Uint ErrorCode, tRegs *Regs);
+
int
MM_PageFault(tVAddr Addr, Uint ErrorCode, tRegs *Regs);
void Error_Backtrace(Uint IP, Uint BP);
// === PROTOTYPES ===
void Error_Backtrace(Uint IP, Uint BP);
// === PROTOTYPES ===
@@
-34,11
+34,14
@@
void Error_Handler(tRegs *Regs)
if( Regs->IntNum == 14 ) {
__asm__ __volatile__ ("mov %%cr2, %0":"=r"(cr));
if( Regs->IntNum == 14 ) {
__asm__ __volatile__ ("mov %%cr2, %0":"=r"(cr));
- MM_PageFault(cr, Regs->ErrorCode, Regs);
- return ;
+ if( MM_PageFault(cr, Regs->ErrorCode, Regs) == 0 )
+ return ;
+ }
+ else {
+ Debug_KernelPanic();
+
+ Error_Backtrace(Regs->RIP, Regs->RBP);
}
}
-
- Debug_KernelPanic();
Log("CPU Error %x, Code: 0x%x", Regs->IntNum, Regs->ErrorCode);
// Log(" - %s", csaERROR_NAMES[Regs->IntNum]);
Log("CPU Error %x, Code: 0x%x", Regs->IntNum, Regs->ErrorCode);
// Log(" - %s", csaERROR_NAMES[Regs->IntNum]);
@@
-98,8
+101,7
@@
void Error_Backtrace(Uint IP, Uint BP)
// return;
//}
// return;
//}
- if( IP > MM_USER_MAX
- && IP < MM_KERNEL_CODE
+ if( IP > USER_MAX && IP < MM_KERNEL_CODE
&& (MM_MODULE_MIN > IP || IP > MM_MODULE_MAX)
)
{
&& (MM_MODULE_MIN > IP || IP > MM_MODULE_MAX)
)
{
@@
-119,7
+121,7
@@
void Error_Backtrace(Uint IP, Uint BP)
}
}
- while( MM_GetPhysAddr(BP) && i < MAX_BACKTRACE )
+ while( MM_GetPhysAddr(BP) &&
MM_GetPhysAddr(BP+8+7) &&
i < MAX_BACKTRACE )
{
//str = Debug_GetSymbol(*(Uint*)(ebp+4), &delta);
//if(str == NULL)
{
//str = Debug_GetSymbol(*(Uint*)(ebp+4), &delta);
//if(str == NULL)
UCC
git Repository :: git.ucc.asn.au