mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:57:44 +00:00
Kernel: Fix incorrect indentation
Looks like a tab and some other things snuck in. :)
This commit is contained in:
parent
f998cc156f
commit
8aafbd917a
2 changed files with 38 additions and 33 deletions
|
@ -45,7 +45,7 @@ static EntropySource s_entropy_source_interrupts { EntropySource::Static::Interr
|
||||||
#define EH_ENTRY(ec, title) \
|
#define EH_ENTRY(ec, title) \
|
||||||
extern "C" void title##_asm_entry(); \
|
extern "C" void title##_asm_entry(); \
|
||||||
extern "C" void title##_handler(TrapFrame*) __attribute__((used)); \
|
extern "C" void title##_handler(TrapFrame*) __attribute__((used)); \
|
||||||
NAKED void title##_asm_entry(){ \
|
NAKED void title##_asm_entry() { \
|
||||||
asm( \
|
asm( \
|
||||||
" pusha\n" \
|
" pusha\n" \
|
||||||
" pushl %ds\n" \
|
" pushl %ds\n" \
|
||||||
|
@ -64,13 +64,14 @@ static EntropySource s_entropy_source_interrupts { EntropySource::Static::Interr
|
||||||
" cld\n" \
|
" cld\n" \
|
||||||
" call enter_trap_no_irq \n" \
|
" call enter_trap_no_irq \n" \
|
||||||
" call " #title "_handler\n" \
|
" call " #title "_handler\n" \
|
||||||
" jmp common_trap_exit \n"); \
|
" jmp common_trap_exit \n" \
|
||||||
|
); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define EH_ENTRY_NO_CODE(ec, title) \
|
#define EH_ENTRY_NO_CODE(ec, title) \
|
||||||
extern "C" void title##_asm_entry(); \
|
extern "C" void title##_asm_entry(); \
|
||||||
extern "C" void title##_handler(TrapFrame*) __attribute__((used)); \
|
extern "C" void title##_handler(TrapFrame*) __attribute__((used)); \
|
||||||
NAKED void title##_asm_entry(){ \
|
NAKED void title##_asm_entry() { \
|
||||||
asm( \
|
asm( \
|
||||||
" pushl $0x0\n" \
|
" pushl $0x0\n" \
|
||||||
" pusha\n" \
|
" pusha\n" \
|
||||||
|
@ -90,14 +91,15 @@ static EntropySource s_entropy_source_interrupts { EntropySource::Static::Interr
|
||||||
" cld\n" \
|
" cld\n" \
|
||||||
" call enter_trap_no_irq \n" \
|
" call enter_trap_no_irq \n" \
|
||||||
" call " #title "_handler\n" \
|
" call " #title "_handler\n" \
|
||||||
" jmp common_trap_exit \n"); \
|
" jmp common_trap_exit \n" \
|
||||||
|
); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif ARCH(X86_64)
|
#elif ARCH(X86_64)
|
||||||
#define EH_ENTRY(ec, title) \
|
#define EH_ENTRY(ec, title) \
|
||||||
extern "C" void title##_asm_entry(); \
|
extern "C" void title##_asm_entry(); \
|
||||||
extern "C" void title##_handler(TrapFrame*) __attribute__((used)); \
|
extern "C" void title##_handler(TrapFrame*) __attribute__((used)); \
|
||||||
NAKED void title##_asm_entry(){ \
|
NAKED void title##_asm_entry() { \
|
||||||
asm( \
|
asm( \
|
||||||
" pushq %r15\n" \
|
" pushq %r15\n" \
|
||||||
" pushq %r14\n" \
|
" pushq %r14\n" \
|
||||||
|
@ -124,13 +126,14 @@ static EntropySource s_entropy_source_interrupts { EntropySource::Static::Interr
|
||||||
" lea 0x8(%rsp), %rdi \n" \
|
" lea 0x8(%rsp), %rdi \n" \
|
||||||
" call " #title "_handler\n" \
|
" call " #title "_handler\n" \
|
||||||
" addq $0x8, %rsp\n" /* undo alignment */ \
|
" addq $0x8, %rsp\n" /* undo alignment */ \
|
||||||
" jmp common_trap_exit \n"); \
|
" jmp common_trap_exit \n" \
|
||||||
|
); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define EH_ENTRY_NO_CODE(ec, title) \
|
#define EH_ENTRY_NO_CODE(ec, title) \
|
||||||
extern "C" void title##_handler(TrapFrame*) __attribute__((used)); \
|
extern "C" void title##_handler(TrapFrame*) __attribute__((used)); \
|
||||||
extern "C" void title##_asm_entry(); \
|
extern "C" void title##_asm_entry(); \
|
||||||
NAKED void title##_asm_entry(){ \
|
NAKED void title##_asm_entry() { \
|
||||||
asm( \
|
asm( \
|
||||||
" pushq $0x0\n" \
|
" pushq $0x0\n" \
|
||||||
" pushq %r15\n" \
|
" pushq %r15\n" \
|
||||||
|
@ -156,7 +159,8 @@ static EntropySource s_entropy_source_interrupts { EntropySource::Static::Interr
|
||||||
" call enter_trap_no_irq \n" \
|
" call enter_trap_no_irq \n" \
|
||||||
" movq %rsp, %rdi \n" \
|
" movq %rsp, %rdi \n" \
|
||||||
" call " #title "_handler\n" \
|
" call " #title "_handler\n" \
|
||||||
" jmp common_trap_exit \n"); \
|
" jmp common_trap_exit \n" \
|
||||||
|
); \
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -22,15 +22,16 @@ NAKED void thread_context_first_enter(void)
|
||||||
// clang-format off
|
// clang-format off
|
||||||
// enter_thread_context returns to here first time a thread is executing
|
// enter_thread_context returns to here first time a thread is executing
|
||||||
asm(
|
asm(
|
||||||
// switch_context will have pushed from_thread and to_thread to our new
|
// switch_context will have pushed from_thread and to_thread to our new
|
||||||
// stack prior to thread_context_first_enter() being called, and the
|
// stack prior to thread_context_first_enter() being called, and the
|
||||||
// pointer to TrapFrame was the top of the stack before that
|
// pointer to TrapFrame was the top of the stack before that
|
||||||
" movl 8(%esp), %ebx \n" // save pointer to TrapFrame
|
" movl 8(%esp), %ebx \n" // save pointer to TrapFrame
|
||||||
" cld \n"
|
" cld \n"
|
||||||
" call context_first_init \n"
|
" call context_first_init \n"
|
||||||
" addl $" __STRINGIFY(ENTER_THREAD_CONTEXT_ARGS_SIZE) ", %esp \n"
|
" addl $" __STRINGIFY(ENTER_THREAD_CONTEXT_ARGS_SIZE) ", %esp \n"
|
||||||
" movl %ebx, 0(%esp) \n" // push pointer to TrapFrame
|
" movl %ebx, 0(%esp) \n" // push pointer to TrapFrame
|
||||||
" jmp common_trap_exit \n");
|
" jmp common_trap_exit \n"
|
||||||
|
);
|
||||||
// clang-format on
|
// clang-format on
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,21 +40,21 @@ NAKED void do_assume_context(Thread*, u32)
|
||||||
// clang-format off
|
// clang-format off
|
||||||
// FIXME: I hope (Thread* thread, u32 flags) aren't compiled away
|
// FIXME: I hope (Thread* thread, u32 flags) aren't compiled away
|
||||||
asm(
|
asm(
|
||||||
" movl 4(%esp), %ebx \n"
|
" movl 4(%esp), %ebx \n"
|
||||||
" movl 8(%esp), %esi \n"
|
" movl 8(%esp), %esi \n"
|
||||||
// We're going to call Processor::init_context, so just make sure
|
// We're going to call Processor::init_context, so just make sure
|
||||||
// we have enough stack space so we don't stomp over it
|
// we have enough stack space so we don't stomp over it
|
||||||
" subl $(" __STRINGIFY(4 + REGISTER_STATE_SIZE + TRAP_FRAME_SIZE + 4) "), %esp \n"
|
" subl $(" __STRINGIFY(4 + REGISTER_STATE_SIZE + TRAP_FRAME_SIZE + 4) "), %esp \n"
|
||||||
" pushl %esi \n"
|
" pushl %esi \n"
|
||||||
" pushl %ebx \n"
|
" pushl %ebx \n"
|
||||||
" cld \n"
|
" cld \n"
|
||||||
" call do_init_context \n"
|
" call do_init_context \n"
|
||||||
" addl $8, %esp \n"
|
" addl $8, %esp \n"
|
||||||
" movl %eax, %esp \n" // move stack pointer to what Processor::init_context set up for us
|
" movl %eax, %esp \n" // move stack pointer to what Processor::init_context set up for us
|
||||||
" pushl %ebx \n" // push to_thread
|
" pushl %ebx \n" // push to_thread
|
||||||
" pushl %ebx \n" // push from_thread
|
" pushl %ebx \n" // push from_thread
|
||||||
" pushl $thread_context_first_enter \n" // should be same as regs.eip
|
" pushl $thread_context_first_enter \n" // should be same as regs.eip
|
||||||
" jmp enter_thread_context \n"
|
" jmp enter_thread_context \n"
|
||||||
);
|
);
|
||||||
// clang-format on
|
// clang-format on
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue