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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue