mirror of
https://github.com/isometimes/rpi4-osdev
synced 2024-11-09 20:00:40 +00:00
30 lines
600 B
C
30 lines
600 B
C
|
#include "multicore.h"
|
||
|
|
||
|
void store32(unsigned long address, unsigned long value)
|
||
|
{
|
||
|
*(unsigned long *) address = value;
|
||
|
}
|
||
|
|
||
|
unsigned long load32(unsigned long address)
|
||
|
{
|
||
|
return *(unsigned long *) address;
|
||
|
}
|
||
|
|
||
|
void start_core1(void (*func)(void))
|
||
|
{
|
||
|
store32((unsigned long)&spin_cpu1, (unsigned long)func);
|
||
|
asm volatile ("sev");
|
||
|
}
|
||
|
|
||
|
void start_core2(void (*func)(void))
|
||
|
{
|
||
|
store32((unsigned long)&spin_cpu2, (unsigned long)func);
|
||
|
asm volatile ("sev");
|
||
|
}
|
||
|
|
||
|
void start_core3(void (*func)(void))
|
||
|
{
|
||
|
store32((unsigned long)&spin_cpu3, (unsigned long)func);
|
||
|
asm volatile ("sev");
|
||
|
}
|