#include <ubixos/smp.h>#include <ubixos/spinlock.h>#include <ubixos/kpanic.h>#include <lib/kprintf.h>#include <lib/string.h>#include <sys/io.h>Include dependency graph for smp.c:

Go to the source code of this file.
Data Structures | |
| struct | gdt_descr |
Functions | |
| void | ap_trampoline_end () |
| void | ap_trampoline_start () |
| void | apicMagic (void) |
| static unsigned int | apicRead (address) |
| static void | apicWrite (unsigned int address, unsigned int data) |
| asm (".globl cpuid \n""cpuid: \n"" pushl %ebx \n"" pushl %edi \n"" movl 12(%esp),%eax \n"" movl 16(%esp),%edi \n"" cpuid \n"" movl %eax,0(%edi) \n"" movl %ebx,4(%edi) \n"" movl %ecx,8(%edi) \n"" movl %edx,12(%edi) \n"" popl %edi \n"" popl %ebx \n"" ret \n") | |
| void | c_ap_boot (void) |
| void | cpu0_thread (void) |
| void | cpu1_thread (void) |
| void | cpu2_thread (void) |
| void | cpu3_thread (void) |
| void | cpuidDetect () |
| uInt8 | cpuInfo () |
| static void | GDT_fixer () |
| static __inline__ uInt32 | getDr3 (void) |
| uInt32 | getEflags () |
| uInt8 | kernel_function (void) |
| static __inline__ void | setDr3 (void *dr3) |
| void | setEflags (uInt32 eflags) |
| void | smpInit () |
Variables | |
| static spinLock_t | bkl = SPIN_LOCK_INITIALIZER |
| cpuinfo_t | cpuinfo [8] |
| static spinLock_t | cpuInfoLock = SPIN_LOCK_INITIALIZER |
| static uInt32 | cpus = 0 |
| static spinLock_t | initSpinLock = SPIN_LOCK_INITIALIZER |
| uInt8 * | vram = (uInt8 *)0xB8000 |
| void ap_trampoline_end | ( | ) |
Referenced by apicMagic().
| void ap_trampoline_start | ( | ) |
| void apicMagic | ( | void | ) |
Definition at line 234 of file smp.c.
References ap_trampoline_end(), ap_trampoline_start, apicRead(), apicWrite(), kprintf(), and memcpy().
Referenced by smpInit().
Here is the call graph for this function:

| static unsigned int apicRead | ( | address | ) | [inline, static] |
| static void apicWrite | ( | unsigned int | address, | |
| unsigned int | data | |||
| ) | [inline, static] |
| asm | ( | ".globl cpuid \n""cpuid: \n"" pushl %ebx \n"" pushl %edi \n"" movl | 12(%esp), | |
| %eax\n""movl | 16(%esp), | |||
| %edi\n""cpuid\n""movl% | eax, | |||
| 0(%edi)\n""movl% | ebx, | |||
| 4(%edi)\n""movl% | ecx, | |||
| 8(%edi)\n""movl% | edx, | |||
| 12(%edi)\n""popl%edi\n""popl%ebx\n""ret\n" | ||||
| ) |
| void c_ap_boot | ( | void | ) |
Definition at line 137 of file smp.c.
References cpu1_thread(), cpu2_thread(), cpu3_thread(), cpuInfo(), initSpinLock, outportByte(), spinLockLocked(), and xe9.
Here is the call graph for this function:

| void cpu0_thread | ( | void | ) |
Definition at line 97 of file smp.c.
References kernel_function(), and vram.
Here is the call graph for this function:

| void cpu1_thread | ( | void | ) |
Definition at line 103 of file smp.c.
References kernel_function(), and vram.
Referenced by c_ap_boot().
Here is the call graph for this function:

| void cpu2_thread | ( | void | ) |
Definition at line 109 of file smp.c.
References kernel_function(), and vram.
Referenced by c_ap_boot().
Here is the call graph for this function:

| void cpu3_thread | ( | void | ) |
Definition at line 115 of file smp.c.
References kernel_function(), and vram.
Referenced by c_ap_boot().
Here is the call graph for this function:

| void cpuidDetect | ( | ) |
Definition at line 173 of file smp.c.
References getEflags(), kpanic(), and setEflags().
Referenced by smpInit().
Here is the call graph for this function:

| uInt8 cpuInfo | ( | ) |
Definition at line 182 of file smp.c.
References cpuinfo_t::apic_id, cpuinfo_t::apic_ver, apicRead(), cpuinfo_t::brand, cpuid(), cpuinfo, cpuInfoLock, cpus, cpuinfo_t::feature, getEflags(), cpuinfo_t::id, cpuinfo_t::ident, kpanic(), cpuinfo_t::max, cpuinfo_t::ok, setDr3(), setEflags(), cpuinfo_t::signature, spinLock(), spinUnlock(), x20, and x30.
Referenced by c_ap_boot(), and smpInit().
Here is the call graph for this function:

| static void GDT_fixer | ( | ) | [static] |
| static __inline__ uInt32 getDr3 | ( | void | ) | [static] |
| uInt32 getEflags | ( | ) |
| uInt8 kernel_function | ( | void | ) |
Definition at line 123 of file smp.c.
References getDr3(), cpuinfo_t::id, spinLock(), and spinUnlock().
Referenced by cpu0_thread(), cpu1_thread(), cpu2_thread(), and cpu3_thread().
Here is the call graph for this function:

| static __inline__ void setDr3 | ( | void * | dr3 | ) | [static] |
| void setEflags | ( | uInt32 | eflags | ) |
| void smpInit | ( | ) |
Definition at line 161 of file smp.c.
References apicMagic(), cpuidDetect(), cpuInfo(), GDT_fixer(), initSpinLock, spinLock(), and spinUnlock().
Here is the call graph for this function:

spinLock_t bkl = SPIN_LOCK_INITIALIZER [static] |
spinLock_t cpuInfoLock = SPIN_LOCK_INITIALIZER [static] |
spinLock_t initSpinLock = SPIN_LOCK_INITIALIZER [static] |
Definition at line 43 of file smp.c.
Referenced by cpu0_thread(), cpu1_thread(), cpu2_thread(), and cpu3_thread().
1.4.7