UbixOS  2.0
smp.c File Reference
#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)
 
 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 ()
 
uInt32 getEflags ()
 
uInt8 kernel_function (void)
 
void setEflags (uInt32 eflags)
 
void smpInit ()
 

Variables

struct cpuinfo_t cpuinfo [8]
 
uInt8vram = (uInt8 *)0xB8000
 

Function Documentation

◆ ap_trampoline_end()

void ap_trampoline_end ( )

Referenced by apicMagic().

◆ ap_trampoline_start()

void ap_trampoline_start ( )

Referenced by apicMagic().

◆ apicMagic()

void apicMagic ( void  )

Definition at line 231 of file smp.c.

References ap_trampoline_end(), ap_trampoline_start(), kprintf(), and memcpy().

Here is the call graph for this function:

◆ asm()

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"   
)

◆ c_ap_boot()

void c_ap_boot ( void  )

Definition at line 133 of file smp.c.

References spinLockLocked().

Here is the call graph for this function:

◆ cpu0_thread()

void cpu0_thread ( void  )

Definition at line 95 of file smp.c.

References kernel_function(), and vram.

Here is the call graph for this function:

◆ cpu1_thread()

void cpu1_thread ( void  )

Definition at line 101 of file smp.c.

References kernel_function(), and vram.

Here is the call graph for this function:

◆ cpu2_thread()

void cpu2_thread ( void  )

Definition at line 107 of file smp.c.

References kernel_function(), and vram.

Here is the call graph for this function:

◆ cpu3_thread()

void cpu3_thread ( void  )

Definition at line 113 of file smp.c.

References kernel_function(), and vram.

Here is the call graph for this function:

◆ cpuidDetect()

void cpuidDetect ( )

Definition at line 168 of file smp.c.

References getEflags(), kpanic(), and setEflags().

Here is the call graph for this function:

◆ cpuInfo()

uInt8 cpuInfo ( )

Definition at line 177 of file smp.c.

References getEflags(), kpanic(), setEflags(), and spinLock().

Here is the call graph for this function:

◆ getEflags()

uInt32 getEflags ( )

Definition at line 253 of file smp.c.

Referenced by cpuidDetect(), and cpuInfo().

◆ kernel_function()

uInt8 kernel_function ( void  )

Definition at line 121 of file smp.c.

References spinLock().

Referenced by cpu0_thread(), cpu1_thread(), cpu2_thread(), and cpu3_thread().

Here is the call graph for this function:

◆ setEflags()

void setEflags ( uInt32  eflags)

Definition at line 263 of file smp.c.

Referenced by cpuidDetect(), and cpuInfo().

◆ smpInit()

void smpInit ( )

Definition at line 156 of file smp.c.

References spinLock().

Here is the call graph for this function:

Variable Documentation

◆ cpuinfo

struct cpuinfo_t cpuinfo[8]

Definition at line 39 of file smp.c.

◆ vram

uInt8* vram = (uInt8 *)0xB8000

Definition at line 42 of file smp.c.

Referenced by cpu0_thread(), cpu1_thread(), cpu2_thread(), and cpu3_thread().