Fix stack overruns
This commit is contained in:
@@ -48,7 +48,7 @@ interrupts_disable:
|
||||
section .bss
|
||||
align 0x100
|
||||
idle_stack_begin:
|
||||
resb 0x1000 ; 4KiB stack space
|
||||
resb 0x4000 ; 16KiB stack space
|
||||
|
||||
global idle_stack_end
|
||||
idle_stack_end:
|
||||
|
||||
@@ -184,7 +184,10 @@ isr_handler(cpu_state *regs)
|
||||
uintptr_t cr2 = 0;
|
||||
__asm__ __volatile__ ("mov %%cr2, %0" : "=r"(cr2));
|
||||
|
||||
if (!page_manager::get()->fault_handler(cr2)) {
|
||||
if ((regs->errorcode & 0x9) == 0 &&
|
||||
page_manager::get()->fault_handler(cr2))
|
||||
break;
|
||||
|
||||
cons->set_color(11);
|
||||
cons->puts("\nPage Fault:\n");
|
||||
cons->set_color();
|
||||
@@ -200,7 +203,6 @@ isr_handler(cpu_state *regs)
|
||||
print_stacktrace(2);
|
||||
_halt();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case isr::isrTimer:
|
||||
|
||||
@@ -110,7 +110,7 @@ void fatal(area_t area, const char *fmt, ...);
|
||||
} // namespace log
|
||||
|
||||
namespace logs {
|
||||
#define LOG(name, lvl) extern log::area_t name;
|
||||
#define LOG(name, lvl) extern const log::area_t name;
|
||||
#include "log_areas.inc"
|
||||
#undef LOG
|
||||
} // namespace logs
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
/// \returns An allocated element
|
||||
inline item_type * pop()
|
||||
{
|
||||
if (this->empty()) allocate();
|
||||
if (this->empty()) this->allocate();
|
||||
kassert(!this->empty(), "Slab allocator is empty after allocate()");
|
||||
item_type *item = this->pop_front();
|
||||
kutil::memset(item, 0, sizeof(item_type));
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
namespace kutil {
|
||||
namespace logs {
|
||||
#define LOG(name, lvl) \
|
||||
log::area_t name = #name ## _h; \
|
||||
const log::area_t name = #name ## _h; \
|
||||
const char * name ## _name = #name;
|
||||
#include "log_areas.inc"
|
||||
#undef LOG
|
||||
@@ -19,7 +19,7 @@ using kutil::memset;
|
||||
using kutil::memcpy;
|
||||
|
||||
logger *logger::s_log = nullptr;
|
||||
const char *logger::s_level_names[] = {"", "debug", " info", " warn", "error", "fatal"};
|
||||
const char *logger::s_level_names[] = {"", "debug", "info", "warn", "error", "fatal"};
|
||||
|
||||
logger::logger() :
|
||||
m_buffer(nullptr, 0),
|
||||
|
||||
Reference in New Issue
Block a user