chore: clang format
This commit is contained in:
parent
f5ea31f676
commit
b317827c3c
16 changed files with 216 additions and 181 deletions
|
@ -1,5 +1,5 @@
|
|||
#include <stdatomic.h>
|
||||
#include "platform.h"
|
||||
#include <stdatomic.h>
|
||||
|
||||
int __am_mpe_init = 0;
|
||||
extern bool __am_has_ioe;
|
||||
|
@ -16,7 +16,8 @@ bool mpe_init(void (*entry)()) {
|
|||
char ch;
|
||||
assert(read(sync_pipe[0], &ch, 1) == 1);
|
||||
assert(ch == '+');
|
||||
close(sync_pipe[0]); close(sync_pipe[1]);
|
||||
close(sync_pipe[0]);
|
||||
close(sync_pipe[1]);
|
||||
|
||||
thiscpu->cpuid = i;
|
||||
__am_init_timer_irq();
|
||||
|
@ -31,8 +32,9 @@ bool mpe_init(void (*entry)()) {
|
|||
for (int i = 1; i < cpu_count(); i++) {
|
||||
assert(write(sync_pipe[1], "+", 1) == 1);
|
||||
}
|
||||
close(sync_pipe[0]); close(sync_pipe[1]);
|
||||
|
||||
close(sync_pipe[0]);
|
||||
close(sync_pipe[1]);
|
||||
|
||||
entry();
|
||||
panic("MP entry should not return\n");
|
||||
}
|
||||
|
@ -42,9 +44,7 @@ int cpu_count() {
|
|||
return __am_ncpu;
|
||||
}
|
||||
|
||||
int cpu_current() {
|
||||
return thiscpu->cpuid;
|
||||
}
|
||||
int cpu_current() { return thiscpu->cpuid; }
|
||||
|
||||
int atomic_xchg(int *addr, int newval) {
|
||||
return atomic_exchange((int *)addr, newval);
|
||||
|
|
|
@ -55,25 +55,25 @@ __am_iret:
|
|||
popl %edi
|
||||
popl %ebp
|
||||
iret
|
||||
|
||||
|
||||
.kernel_iret:
|
||||
popl %eax
|
||||
popl %ebx
|
||||
popl %ecx
|
||||
popl %edx
|
||||
addl $4, %esp
|
||||
|
||||
|
||||
/* stack frame:
|
||||
28 ss
|
||||
24 esp (not popped by iret when returning to ring0)
|
||||
20 eflags ---> move to new-esp
|
||||
16 cs
|
||||
12 eip
|
||||
8 ebp
|
||||
4 edi
|
||||
8 ebp
|
||||
4 edi
|
||||
0 esi <--- %esp
|
||||
*/
|
||||
|
||||
|
||||
movl %esp, %ebp
|
||||
movl 24(%ebp), %edi // %edi is new-esp
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue