Support O2 optimization

This commit is contained in:
TXuian
2024-04-29 18:27:28 +08:00
parent 88ded7ca16
commit 077dcd66ac
18 changed files with 77 additions and 97 deletions

View File

@@ -49,7 +49,7 @@ Modification:
#include "task.h"
extern void context_switch(struct context**, struct context*);
void dabort_handler(struct trapframe* r)
__attribute__((optimize("O0"))) void dabort_handler(struct trapframe* r)
{
if (r->pc >= DEV_VRTMEM_BASE && is_spinlock_hold_by_current_cpu(&whole_kernel_lock)) {
assert(is_spinlock_hold_by_current_cpu(&whole_kernel_lock));
@@ -69,7 +69,7 @@ void dabort_handler(struct trapframe* r)
panic("dabort end should never be reashed.\n");
}
void iabort_handler(struct trapframe* r)
__attribute__((optimize("O0"))) void iabort_handler(struct trapframe* r)
{
if (r->pc >= DEV_VRTMEM_BASE && is_spinlock_hold_by_current_cpu(&whole_kernel_lock)) {
assert(is_spinlock_hold_by_current_cpu(&whole_kernel_lock));