ia32
[Miscellanea]


Files

file  arch.h
file  arg.h
file  asm.h
file  atomic.h
file  barrier.h
file  bios.h
file  boot.h
file  memmap.h
file  byteorder.h
file  context.h
file  cpu.h
file  cpuid.h
file  ega.h
file  i8042.h
file  i8254.h
file  i8259.h
file  vesa.h
file  elf.h
file  faddr.h
file  fpu_context.h
file  memstr.h
file  pm.h
file  ap.h
file  apic.h
file  mps.h
file  smp.h
file  types.h
file  bios.c
file  cpu.c
file  ega.c
file  i8254.c
file  i8259.c
file  vesa.c
file  fpu_context.c
file  ia32.c
file  pm.c
file  apic.c
file  ipi.c
file  mps.c
file  smp.c
file  userspace.c

Data Structures

struct  e820memmap_
struct  context
struct  cpu_arch
struct  cpu_info
struct  __cpuid_extended_feature_info
union  cpuid_extended_feature_info
struct  __cpuid_feature_info
union  cpuid_feature_info
struct  fpu_context
struct  ptr_16_32
struct  descriptor
struct  idescriptor
struct  tss
struct  icr
union  esr
union  tpr
union  svr
union  tdcr
union  lvt_tm
union  lvt_lint
union  lvt_error
union  l_apic_id
union  ldr
union  dfr
union  io_regsel
struct  io_redirection_reg
union  io_apic_id
struct  mps_fs
struct  mps_ct
struct  __processor_entry
struct  __bus_entry
struct  __io_apic_entry
struct  __io_intr_entry
struct  __l_intr_entry
struct  smp_config_operations

Defines

#define GEN_READ_REG(reg)
#define GEN_WRITE_REG(reg)
#define atomic_preinc(val)   (atomic_postinc(val)+1)
#define atomic_predec(val)   (atomic_postdec(val)-1)
#define CS_ENTER_BARRIER()   __asm__ volatile ("" ::: "memory")
#define CS_LEAVE_BARRIER()   __asm__ volatile ("" ::: "memory")
#define memory_barrier()   cpuid_serialization()
#define read_barrier()   cpuid_serialization()
#define write_barrier()   __asm__ volatile( "" ::: "memory");
#define BIOS_EBDA_PTR   0x40e
#define BOOT_OFFSET   0x108000
#define AP_BOOT_OFFSET   0x8000
#define BOOT_STACK_SIZE   0x400
#define MULTIBOOT_HEADER_MAGIC   0x1BADB002
#define MULTIBOOT_HEADER_FLAGS   0x00010003
#define MULTIBOOT_LOADER_MAGIC   0x2BADB002
#define MEMMAP_MEMORY_AVAILABLE   1
#define MEMMAP_MEMORY_RESERVED   2
#define MEMMAP_MEMORY_ACPI   3
#define MEMMAP_MEMORY_NVS   4
#define MEMMAP_MEMORY_UNUSABLE   5
#define MEMMAP_E820_RECORD_SIZE   20
#define MEMMAP_E820_MAX_RECORDS   32
#define __native_le2host(n)   (n)
#define __u64_le2host(n)   (n)
#define STACK_ITEM_SIZE   4
#define SP_DELTA   (8+STACK_ITEM_SIZE)
#define EFLAGS_IF   (1 << 9)
#define EFLAGS_RF   (1 << 16)
#define CR4_OSFXSR_MASK   (1<<9)
#define VIDEORAM   0xb8000
#define ROW   80
#define ROWS   25
#define SCREEN   (ROW * ROWS)
#define i8042_DATA   0x60
#define i8042_STATUS   0x64
#define PIC_PIC0PORT1   0x20
#define PIC_PIC0PORT2   0x21
#define PIC_PIC1PORT1   0xa0
#define PIC_PIC1PORT2   0xa1
#define PIC_NEEDICW4   (1<<0)
#define PIC_ICW1   (1<<4)
#define ELF_MACHINE   EM_386
#define ELF_DATA_ENCODING   ELFDATA2LSB
#define ELF_CLASS   ELFCLASS32
#define FADDR(fptr)   ((__address) (fptr))
#define ARCH_HAS_FPU
#define FPU_CONTEXT_ALIGN   16
#define IDT_ITEMS   64
#define GDT_ITEMS   7
#define VESA_INIT_SEGMENT   0x8000
#define NULL_DES   0
#define KTEXT_DES   1
#define KDATA_DES   2
#define UTEXT_DES   3
#define UDATA_DES   4
#define TSS_DES   5
#define TLS_DES   6
#define selector(des)   ((des)<<3)
#define PL_KERNEL   0
#define PL_USER   3
#define AR_PRESENT   (1<<7)
#define AR_DATA   (2<<3)
#define AR_CODE   (3<<3)
#define AR_WRITABLE   (1<<1)
#define AR_INTERRUPT   (0xe)
#define AR_TSS   (0x9)
#define DPL_KERNEL   (PL_KERNEL<<5)
#define DPL_USER   (PL_USER<<5)
#define TSS_BASIC_SIZE   104
#define TSS_IOMAP_SIZE   (16*1024+1)
#define IO_PORTS   (64*1024)
#define FIXED   (0<<0)
#define LOPRI   (1<<0)
#define APIC_ID_COUNT   16
#define IPI_INIT   0
#define IPI_STARTUP   0
#define DELMOD_FIXED   0x0
#define DELMOD_LOWPRI   0x1
#define DELMOD_SMI   0x2
#define DELMOD_NMI   0x4
#define DELMOD_INIT   0x5
#define DELMOD_STARTUP   0x6
#define DELMOD_EXTINT   0x7
#define DESTMOD_PHYS   0x0
#define DESTMOD_LOGIC   0x1
#define TRIGMOD_EDGE   0x0
#define TRIGMOD_LEVEL   0x1
#define LEVEL_DEASSERT   0x0
#define LEVEL_ASSERT   0x1
#define SHORTHAND_NONE   0x0
#define SHORTHAND_SELF   0x1
#define SHORTHAND_ALL_INCL   0x2
#define SHORTHAND_ALL_EXCL   0x3
#define POLARITY_HIGH   0x0
#define POLARITY_LOW   0x1
#define DIVIDE_2   0x0
#define DIVIDE_4   0x1
#define DIVIDE_8   0x2
#define DIVIDE_16   0x3
#define DIVIDE_32   0x8
#define DIVIDE_64   0x9
#define DIVIDE_128   0xa
#define DIVIDE_1   0xb
#define TIMER_ONESHOT   0x0
#define TIMER_PERIODIC   0x1
#define DELIVS_IDLE   0x0
#define DELIVS_PENDING   0x1
#define DEST_ALL   0xff
#define MODEL_FLAT   0xf
#define MODEL_CLUSTER   0x0
#define ICRlo   (0x300/sizeof(__u32))
#define ICRhi   (0x310/sizeof(__u32))
#define EOI   (0x0b0/sizeof(__u32))
#define ESR   (0x280/sizeof(__u32))
#define TPR   (0x080/sizeof(__u32))
#define SVR   (0x0f0/sizeof(__u32))
#define TDCR   (0x3e0/sizeof(__u32))
#define ICRT   (0x380/sizeof(__u32))
#define CCRT   (0x390/sizeof(__u32))
#define LVT_Tm   (0x320/sizeof(__u32))
#define LVT_LINT0   (0x350/sizeof(__u32))
#define LVT_LINT1   (0x360/sizeof(__u32))
#define LVT_Err   (0x370/sizeof(__u32))
#define L_APIC_ID   (0x020/sizeof(__u32))
#define LAVR   (0x030/sizeof(__u32))
#define LAVR_Mask   0xff
#define is_local_apic(x)   (((x)&LAVR_Mask&0xf0)==0x1)
#define is_82489DX_apic(x)   ((((x)&LAVR_Mask&0xf0)==0x0))
#define is_local_xapic(x)   (((x)&LAVR_Mask)==0x14)
#define LDR   (0x0d0/sizeof(__u32))
#define DFR   (0x0e0/sizeof(__u32))
#define IOREGSEL   (0x00/sizeof(__u32))
#define IOWIN   (0x10/sizeof(__u32))
#define IOAPICID   0x00
#define IOAPICVER   0x01
#define IOAPICARB   0x02
#define IOREDTBL   0x10
#define CT_EXT_ENTRY_TYPE   0
#define CT_EXT_ENTRY_LEN   1
#define NULL   0
#define AMD_CPUID_EBX   0x68747541
#define AMD_CPUID_ECX   0x444d4163
#define AMD_CPUID_EDX   0x69746e65
#define INTEL_CPUID_EBX   0x756e6547
#define INTEL_CPUID_ECX   0x6c65746e
#define INTEL_CPUID_EDX   0x49656e69
#define CLK_PORT1   0x40
#define CLK_PORT4   0x43
#define CLK_CONST   1193180
#define MAGIC_NUMBER   1194
#define LOOPS   150000
#define SHIFT   11
#define FS_SIGNATURE   0x5f504d5f
#define CT_SIGNATURE   0x504d4350

Typedefs

typedef ptr_16_32 ptr_16_32_t
typedef descriptor descriptor_t
typedef idescriptor idescriptor_t
typedef tss tss_t
typedef icr icr_t
typedef esr esr_t
typedef tpr tpr_t
typedef svr svr_t
typedef tdcr tdcr_t
typedef lvt_tm lvt_tm_t
typedef lvt_lint lvt_lint_t
typedef lvt_error lvt_error_t
typedef l_apic_id l_apic_id_t
typedef ldr ldr_t
typedef dfr dfr_t
typedef io_regsel io_regsel_t
typedef io_redirection_reg io_redirection_reg_t
typedef io_apic_id io_apic_id_t
typedef signed char __s8
typedef signed short __s16
typedef signed long __s32
typedef signed long long __s64
typedef unsigned char __u8
typedef unsigned short __u16
typedef unsigned long __u32
typedef unsigned long long __u64
typedef __u32 __address
typedef __u32 pfn_t
typedef __u32 ipl_t
typedef __u32 __native
typedef __s32 __snative
typedef page_specifier pte_t
typedef void(* fpu_context_function )(fpu_context_t *fctx)

Enumerations

enum  vendor { VendorUnknown = 0, VendorAMD, VendorIntel }

Functions

void paging_on (void)
void interrupt_handlers (void)
void enable_l_apic_in_msr (void)
void asm_delay_loop (__u32 t)
void asm_fake_loop (__u32 t)
static void cpu_halt (void)
static void cpu_sleep (void)
 GEN_READ_REG (cr0)
 GEN_READ_REG (cr2)
 GEN_READ_REG (cr3)
 GEN_WRITE_REG (cr3)
 GEN_READ_REG (dr0)
 GEN_READ_REG (dr1)
 GEN_READ_REG (dr2)
 GEN_READ_REG (dr3)
 GEN_READ_REG (dr6)
 GEN_READ_REG (dr7)
 GEN_WRITE_REG (dr0)
 GEN_WRITE_REG (dr1)
 GEN_WRITE_REG (dr2)
 GEN_WRITE_REG (dr3)
 GEN_WRITE_REG (dr6)
 GEN_WRITE_REG (dr7)
static void outb (__u16 port, __u8 val)
static void outw (__u16 port, __u16 val)
static void outl (__u16 port, __u32 val)
static __u8 inb (__u16 port)
static __u16 inw (__u16 port)
static __u32 inl (__u16 port)
static ipl_t interrupts_enable (void)
static ipl_t interrupts_disable (void)
static void interrupts_restore (ipl_t ipl)
static ipl_t interrupts_read (void)
static __address get_stack_base (void)
static __u64 rdtsc (void)
static __addressget_ip ()
static void invlpg (__address addr)
static void gdtr_load (ptr_16_32_t *gdtr_reg)
static void gdtr_store (ptr_16_32_t *gdtr_reg)
static void idtr_load (ptr_16_32_t *idtr_reg)
static void tr_load (__u16 sel)
static void atomic_inc (atomic_t *val)
static void atomic_dec (atomic_t *val)
static long atomic_postinc (atomic_t *val)
static long atomic_postdec (atomic_t *val)
static __u32 test_and_set (atomic_t *val)
static void atomic_lock_arch (atomic_t *val)
static void cpuid_serialization (void)
void bios_init (void)
static __u32 has_cpuid (void)
static void cpuid (__u32 cmd, struct cpu_info *info)
void ega_init (void)
static void i8042_data_write (__u8 data)
static __u8 i8042_data_read (void)
static __u8 i8042_status_read (void)
static void i8042_command_write (__u8 command)
void i8254_init (void)
void i8254_calibrate_delay_loop (void)
void i8254_normal_operation (void)
void i8259_init (void)
void pic_enable_irqs (__u16 irqmask)
void pic_disable_irqs (__u16 irqmask)
void pic_eoi (void)
int vesa_present (void)
void vesa_init (void)
void fpu_fxsr (void)
void fpu_fsr (void)
static void * memcpy (void *dst, const void *src, size_t cnt)
static int memcmp (const void *src, const void *dst, size_t cnt)
static void memsetw (__address dst, size_t cnt, __u16 x)
static void memsetb (__address dst, size_t cnt, __u8 x)
void pm_init (void)
void gdt_setbase (descriptor_t *d, __address base)
void gdt_setlimit (descriptor_t *d, __u32 limit)
void idt_init (void)
void idt_setoffset (idescriptor_t *d, __address offset)
void tss_initialize (tss_t *t)
void set_tls_desc (__address tls)
void ap_boot (void)
void apic_init (void)
void l_apic_init (void)
void l_apic_eoi (void)
int l_apic_broadcast_custom_ipi (__u8 vector)
int l_apic_send_init_ipi (__u8 apicid)
void l_apic_debug (void)
__u8 l_apic_id (void)
__u32 io_apic_read (__u8 address)
void io_apic_write (__u8 address, __u32 x)
void io_apic_change_ioredtbl (int pin, int dest, __u8 v, int flags)
void io_apic_disable_irqs (__u16 irqmask)
void io_apic_enable_irqs (__u16 irqmask)
void mps_init (void)
void kmp (void *arg)
int smp_irq_to_pin (int irq)
void fpu_disable (void)
void fpu_enable (void)
void cpu_arch_init (void)
void cpu_identify (void)
void cpu_print_report (cpu_t *m)
 SPINLOCK_INITIALIZE (egalock)
static void ega_putchar (chardev_t *d, const char ch)
void ega_move_cursor (void)
static void ega_display_char (char ch)
static void ega_check_cursor (void)
static void i8254_interrupt (int n, istate_t *istate)
static void pic_spurious (int n, istate_t *istate)
static void fpu_context_f_save (fpu_context_t *fctx)
static void fpu_context_f_restore (fpu_context_t *fctx)
static void fpu_context_fx_save (fpu_context_t *fctx)
static void fpu_context_fx_restore (fpu_context_t *fctx)
void fpu_context_save (fpu_context_t *fctx)
void fpu_context_restore (fpu_context_t *fctx)
void fpu_init ()
void arch_pre_mm_init (void)
void arch_post_mm_init (void)
void arch_pre_smp_init (void)
void arch_post_smp_init (void)
void calibrate_delay_loop (void)
__native sys_tls_set (__native addr)
void arch_grab_console (void)
void arch_release_console (void)
static void clean_IOPL_NT_flags (void)
static void clean_AM_flag (void)
static int apic_poll_errors (void)
static void apic_spurious (int n, istate_t *istate)
static void l_apic_timer_interrupt (int n, istate_t *istate)
void ipi_broadcast_arch (int ipi)
int mps_fs_check (__u8 *base)
int mps_ct_check (void)
int configure_via_ct (void)
int configure_via_default (__u8 n)
int ct_processor_entry (struct __processor_entry *pr)
void ct_bus_entry (struct __bus_entry *bus)
void ct_io_apic_entry (struct __io_apic_entry *ioa)
void ct_io_intr_entry (struct __io_intr_entry *iointr)
void ct_l_intr_entry (struct __l_intr_entry *lintr)
void ct_extended_entries (void)
static count_t get_cpu_count (void)
static bool is_cpu_enabled (index_t i)
static bool is_bsp (index_t i)
static __u8 get_cpu_apic_id (index_t i)
static int mps_irq_to_pin (int irq)
void smp_init (void)
void userspace (uspace_arg_t *kernel_uarg)

Variables

__u32 interrupt_handler_size
__address ebda
e820memmap_ packed
e820memmap_ e820table [MEMMAP_E820_MAX_RECORDS]
__u8 e820counter
__u32 e801memorysize
context packed
cpu_info packed
__cpuid_extended_feature_info packed
__cpuid_feature_info packed
ptr_16_32 packed
descriptor packed
idescriptor packed
tss packed
ptr_16_32_t gdtr
ptr_16_32_t bootstrap_gdtr
ptr_16_32_t protected_ap_gdtr
tsstss_p
descriptor_t gdt []
icr packed
io_redirection_reg packed
volatile __u32l_apic
volatile __u32io_apic
__u32 apic_id_mask
mps_fs packed
mps_ct packed
__processor_entry packed
__bus_entry packed
__io_apic_entry packed
__io_intr_entry packed
__l_intr_entry packed
waitq_t ap_completion_wq
smp_config_operations mps_config_operations
__address ebda = 0
static char * vendor_str []
static __u32 ega_cursor
static __u8videoram
chardev_t ega_console
static chardev_operations_t ega_ops
static fpu_context_function fpu_save
static fpu_context_function fpu_restore
descriptor_t gdt [GDT_ITEMS]
static idescriptor_t idt [IDT_ITEMS]
static tss_t tss
tss_ttss_p = NULL
ptr_16_32_t bootstrap_gdtr = { .limit = sizeof(gdt), .base = KA2PA((__address) gdt) }
ptr_16_32_t gdtr = { .limit = sizeof(gdt), .base = (__address) gdt }
volatile __u32l_apic = (__u32 *) 0xfee00000
volatile __u32io_apic = (__u32 *) 0xfec00000
__u32 apic_id_mask = 0
static struct mps_fsfs
static struct mps_ctct
__processor_entryprocessor_entries = NULL
__bus_entrybus_entries = NULL
__io_apic_entryio_apic_entries = NULL
__io_intr_entryio_intr_entries = NULL
__l_intr_entryl_intr_entries = NULL
int processor_entry_cnt = 0
int bus_entry_cnt = 0
int io_apic_entry_cnt = 0
int io_intr_entry_cnt = 0
int l_intr_entry_cnt = 0
waitq_t ap_completion_wq
smp_config_operations mps_config_operations
static struct smp_config_operationsops = NULL

Define Documentation

#define __native_le2host  )     (n)
 

Definition at line 39 of file byteorder.h.

#define __u64_le2host  )     (n)
 

Definition at line 40 of file byteorder.h.

Referenced by get_symbol_addr(), get_symtab_entry(), and symtab_print_search().

#define AMD_CPUID_EBX   0x68747541
 

Definition at line 51 of file cpu.c.

Referenced by cpu_identify().

#define AMD_CPUID_ECX   0x444d4163
 

Definition at line 52 of file cpu.c.

Referenced by cpu_identify().

#define AMD_CPUID_EDX   0x69746e65
 

Definition at line 53 of file cpu.c.

Referenced by cpu_identify().

#define AP_BOOT_OFFSET   0x8000
 

Definition at line 39 of file boot.h.

Referenced by frame_arch_init().

#define APIC_ID_COUNT   16
 

Definition at line 44 of file apic.h.

#define AR_CODE   (3<<3)
 

Definition at line 68 of file pm.h.

#define AR_DATA   (2<<3)
 

Definition at line 67 of file pm.h.

#define AR_INTERRUPT   (0xe)
 

Definition at line 70 of file pm.h.

Referenced by idt_init().

#define AR_PRESENT   (1<<7)
 

Definition at line 66 of file pm.h.

Referenced by idt_init(), io_perm_bitmap_install(), and pm_init().

#define AR_TSS   (0x9)
 

Definition at line 71 of file pm.h.

Referenced by io_perm_bitmap_install(), and pm_init().

#define AR_WRITABLE   (1<<1)
 

Definition at line 69 of file pm.h.

#define ARCH_HAS_FPU
 

Definition at line 40 of file fpu_context.h.

#define atomic_predec val   )     (atomic_postdec(val)-1)
 

Definition at line 84 of file atomic.h.

#define atomic_preinc val   )     (atomic_postinc(val)+1)
 

Definition at line 83 of file atomic.h.

Referenced by check_call_limit(), ipc_irq_send_msg(), and ipc_irq_send_notif().

#define BIOS_EBDA_PTR   0x40e
 

Definition at line 40 of file bios.h.

Referenced by bios_init().

#define BOOT_OFFSET   0x108000
 

Definition at line 38 of file boot.h.

#define BOOT_STACK_SIZE   0x400
 

Definition at line 40 of file boot.h.

#define CCRT   (0x390/sizeof(__u32))
 

Definition at line 197 of file apic.h.

Referenced by l_apic_init().

#define CLK_CONST   1193180
 

Definition at line 59 of file i8254.c.

Referenced by i8254_normal_operation().

#define CLK_PORT1   0x40
 

Definition at line 55 of file i8254.c.

Referenced by i8254_calibrate_delay_loop(), and i8254_normal_operation().

#define CLK_PORT4   0x43
 

Definition at line 56 of file i8254.c.

Referenced by i8254_calibrate_delay_loop(), and i8254_normal_operation().

#define CR4_OSFXSR_MASK   (1<<9)
 

Definition at line 56 of file cpu.h.

Referenced by cpu_arch_init().

 
#define CS_ENTER_BARRIER  )     __asm__ volatile ("" ::: "memory")
 

Definition at line 49 of file barrier.h.

Referenced by atomic_lock_arch(), and spinlock_trylock().

 
#define CS_LEAVE_BARRIER  )     __asm__ volatile ("" ::: "memory")
 

Definition at line 50 of file barrier.h.

Referenced by spinlock_unlock().

#define CT_EXT_ENTRY_LEN   1
 

Definition at line 45 of file mps.h.

Referenced by ct_extended_entries().

#define CT_EXT_ENTRY_TYPE   0
 

Definition at line 44 of file mps.h.

Referenced by ct_extended_entries().

#define CT_SIGNATURE   0x504d4350
 

Definition at line 56 of file mps.c.

Referenced by configure_via_ct().

#define DELIVS_IDLE   0x0
 

Delivery status.

Definition at line 97 of file apic.h.

#define DELIVS_PENDING   0x1
 

Definition at line 98 of file apic.h.

Referenced by l_apic_broadcast_custom_ipi(), and l_apic_send_init_ipi().

#define DELMOD_EXTINT   0x7
 

Definition at line 58 of file apic.h.

#define DELMOD_FIXED   0x0
 

Delivery modes.

Definition at line 51 of file apic.h.

Referenced by io_apic_change_ioredtbl(), and l_apic_broadcast_custom_ipi().

#define DELMOD_INIT   0x5
 

Definition at line 56 of file apic.h.

Referenced by l_apic_init(), and l_apic_send_init_ipi().

#define DELMOD_LOWPRI   0x1
 

Definition at line 52 of file apic.h.

Referenced by io_apic_change_ioredtbl().

#define DELMOD_NMI   0x4
 

Definition at line 55 of file apic.h.

#define DELMOD_SMI   0x2
 

Definition at line 53 of file apic.h.

#define DELMOD_STARTUP   0x6
 

Definition at line 57 of file apic.h.

Referenced by l_apic_send_init_ipi().

#define DEST_ALL   0xff
 

Destination masks.

Definition at line 101 of file apic.h.

Referenced by apic_init().

#define DESTMOD_LOGIC   0x1
 

Definition at line 62 of file apic.h.

Referenced by io_apic_change_ioredtbl(), and l_apic_broadcast_custom_ipi().

#define DESTMOD_PHYS   0x0
 

Destination modes.

Definition at line 61 of file apic.h.

Referenced by l_apic_init(), and l_apic_send_init_ipi().

#define DFR   (0x0e0/sizeof(__u32))
 

Destination Format Register.

Definition at line 279 of file apic.h.

Referenced by l_apic_init().

#define DIVIDE_1   0xb
 

Definition at line 90 of file apic.h.

Referenced by l_apic_init().

#define DIVIDE_128   0xa
 

Definition at line 89 of file apic.h.

#define DIVIDE_16   0x3
 

Definition at line 86 of file apic.h.

#define DIVIDE_2   0x0
 

Divide Values. (Bit 2 is always 0)

Definition at line 83 of file apic.h.

#define DIVIDE_32   0x8
 

Definition at line 87 of file apic.h.

#define DIVIDE_4   0x1
 

Definition at line 84 of file apic.h.

#define DIVIDE_64   0x9
 

Definition at line 88 of file apic.h.

#define DIVIDE_8   0x2
 

Definition at line 85 of file apic.h.

#define DPL_KERNEL   (PL_KERNEL<<5)
 

Definition at line 73 of file pm.h.

Referenced by io_perm_bitmap_install(), and pm_init().

#define DPL_USER   (PL_USER<<5)
 

Definition at line 74 of file pm.h.

Referenced by idt_init().

#define EFLAGS_IF   (1 << 9)
 

Definition at line 42 of file cpu.h.

#define EFLAGS_RF   (1 << 16)
 

Definition at line 43 of file cpu.h.

#define ELF_CLASS   ELFCLASS32
 

Definition at line 40 of file elf.h.

Referenced by elf_load().

#define ELF_DATA_ENCODING   ELFDATA2LSB
 

Definition at line 39 of file elf.h.

Referenced by elf_load().

#define ELF_MACHINE   EM_386
 

Definition at line 38 of file elf.h.

Referenced by elf_load().

#define EOI   (0x0b0/sizeof(__u32))
 

Definition at line 137 of file apic.h.

Referenced by l_apic_eoi().

#define ESR   (0x280/sizeof(__u32))
 

Error Status Register.

Definition at line 140 of file apic.h.

Referenced by apic_poll_errors().

#define FADDR fptr   )     ((__address) (fptr))
 

Definition at line 40 of file faddr.h.

Referenced by main_ap(), scheduler(), and thread_create().

#define FIXED   (0<<0)
 

Definition at line 41 of file apic.h.

#define FPU_CONTEXT_ALIGN   16
 

Definition at line 41 of file fpu_context.h.

Referenced by thread_init().

#define FS_SIGNATURE   0x5f504d5f
 

Definition at line 55 of file mps.c.

Referenced by mps_init().

#define GDT_ITEMS   7
 

Definition at line 39 of file pm.h.

#define GEN_READ_REG reg   ) 
 

Value:

static inline __native read_ ##reg (void) \
    { \
        __native res; \
        __asm__ volatile ("movl %%" #reg ", %0" : "=r" (res) ); \
        return res; \
    }

Definition at line 63 of file asm.h.

#define GEN_WRITE_REG reg   ) 
 

Value:

static inline void write_ ##reg (__native regn) \
    { \
        __asm__ volatile ("movl %0, %%" #reg : : "r" (regn)); \
    }

Definition at line 70 of file asm.h.

#define i8042_DATA   0x60
 

This file implements ia32 specific access to i8042 registers.

Definition at line 45 of file i8042.h.

Referenced by i8042_data_read(), and i8042_data_write().

#define i8042_STATUS   0x64
 

Definition at line 46 of file i8042.h.

Referenced by i8042_command_write(), and i8042_status_read().

#define ICRhi   (0x310/sizeof(__u32))
 

Definition at line 109 of file apic.h.

Referenced by l_apic_send_init_ipi().

#define ICRlo   (0x300/sizeof(__u32))
 

Interrupt Command Register.

Definition at line 108 of file apic.h.

Referenced by l_apic_broadcast_custom_ipi(), l_apic_init(), and l_apic_send_init_ipi().

#define ICRT   (0x380/sizeof(__u32))
 

Definition at line 194 of file apic.h.

Referenced by l_apic_init().

#define IDT_ITEMS   64
 

Definition at line 38 of file pm.h.

Referenced by idt_init().

#define INTEL_CPUID_EBX   0x756e6547
 

Definition at line 55 of file cpu.c.

Referenced by cpu_identify().

#define INTEL_CPUID_ECX   0x6c65746e
 

Definition at line 56 of file cpu.c.

Referenced by cpu_identify().

#define INTEL_CPUID_EDX   0x49656e69
 

Definition at line 57 of file cpu.c.

Referenced by cpu_identify().

#define IO_PORTS   (64*1024)
 

Definition at line 79 of file pm.h.

Referenced by ddi_iospace_enable_arch().

#define IOAPICARB   0x02
 

Definition at line 295 of file apic.h.

#define IOAPICID   0x00
 

Definition at line 293 of file apic.h.

#define IOAPICVER   0x01
 

Definition at line 294 of file apic.h.

#define IOREDTBL   0x10
 

Definition at line 296 of file apic.h.

Referenced by io_apic_change_ioredtbl(), io_apic_disable_irqs(), and io_apic_enable_irqs().

#define IOREGSEL   (0x00/sizeof(__u32))
 

Definition at line 290 of file apic.h.

Referenced by io_apic_read(), and io_apic_write().

#define IOWIN   (0x10/sizeof(__u32))
 

Definition at line 291 of file apic.h.

Referenced by io_apic_read(), and io_apic_write().

#define IPI_INIT   0
 

Definition at line 47 of file apic.h.

#define IPI_STARTUP   0
 

Definition at line 48 of file apic.h.

#define is_82489DX_apic  )     ((((x)&LAVR_Mask&0xf0)==0x0))
 

Definition at line 264 of file apic.h.

Referenced by l_apic_send_init_ipi().

#define is_local_apic  )     (((x)&LAVR_Mask&0xf0)==0x1)
 

Definition at line 263 of file apic.h.

#define is_local_xapic  )     (((x)&LAVR_Mask)==0x14)
 

Definition at line 265 of file apic.h.

#define KDATA_DES   2
 

Definition at line 45 of file pm.h.

Referenced by before_thread_runs_arch().

#define KTEXT_DES   1
 

Definition at line 44 of file pm.h.

Referenced by idt_init().

#define L_APIC_ID   (0x020/sizeof(__u32))
 

Local APIC ID Register.

Definition at line 250 of file apic.h.

Referenced by l_apic_id().

#define LAVR   (0x030/sizeof(__u32))
 

Local APIC Version Register

Definition at line 261 of file apic.h.

Referenced by l_apic_send_init_ipi().

#define LAVR_Mask   0xff
 

Definition at line 262 of file apic.h.

#define LDR   (0x0d0/sizeof(__u32))
 

Logical Destination Register.

Definition at line 268 of file apic.h.

Referenced by l_apic_init().

#define LEVEL_ASSERT   0x1
 

Definition at line 70 of file apic.h.

Referenced by l_apic_broadcast_custom_ipi(), and l_apic_send_init_ipi().

#define LEVEL_DEASSERT   0x0
 

Levels.

Definition at line 69 of file apic.h.

Referenced by l_apic_init(), and l_apic_send_init_ipi().

#define LOOPS   150000
 

Definition at line 79 of file i8254.c.

Referenced by i8254_calibrate_delay_loop().

#define LOPRI   (1<<0)
 

Definition at line 42 of file apic.h.

Referenced by apic_init(), and io_apic_change_ioredtbl().

#define LVT_Err   (0x370/sizeof(__u32))
 

LVT Error register.

Definition at line 235 of file apic.h.

Referenced by l_apic_debug(), and l_apic_init().

#define LVT_LINT0   (0x350/sizeof(__u32))
 

LVT LINT registers.

Definition at line 216 of file apic.h.

Referenced by l_apic_debug(), and l_apic_init().

#define LVT_LINT1   (0x360/sizeof(__u32))
 

Definition at line 217 of file apic.h.

Referenced by l_apic_debug(), and l_apic_init().

#define LVT_Tm   (0x320/sizeof(__u32))
 

LVT Timer register.

Definition at line 200 of file apic.h.

Referenced by l_apic_debug(), and l_apic_init().

#define MAGIC_NUMBER   1194
 

Definition at line 60 of file i8254.c.

Referenced by i8254_calibrate_delay_loop().

#define MEMMAP_E820_MAX_RECORDS   32
 

Definition at line 53 of file memmap.h.

#define MEMMAP_E820_RECORD_SIZE   20
 

Definition at line 51 of file memmap.h.

#define MEMMAP_MEMORY_ACPI   3
 

Definition at line 44 of file memmap.h.

Referenced by memory_print_map().

#define MEMMAP_MEMORY_AVAILABLE   1
 

Definition at line 40 of file memmap.h.

Referenced by init_e820_memory(), and memory_print_map().

#define MEMMAP_MEMORY_NVS   4
 

Definition at line 46 of file memmap.h.

Referenced by memory_print_map().

#define MEMMAP_MEMORY_RESERVED   2
 

Definition at line 42 of file memmap.h.

Referenced by memory_print_map().

#define MEMMAP_MEMORY_UNUSABLE   5
 

Definition at line 48 of file memmap.h.

Referenced by cmd_e820mem(), and memory_print_map().

 
#define memory_barrier  )     cpuid_serialization()
 

Definition at line 78 of file barrier.h.

Referenced by preemption_disable(), and preemption_enable().

#define MODEL_CLUSTER   0x0
 

Definition at line 105 of file apic.h.

#define MODEL_FLAT   0xf
 

Dest format models.

Definition at line 104 of file apic.h.

Referenced by l_apic_init().

#define MULTIBOOT_HEADER_FLAGS   0x00010003
 

Definition at line 43 of file boot.h.

#define MULTIBOOT_HEADER_MAGIC   0x1BADB002
 

Definition at line 42 of file boot.h.

#define MULTIBOOT_LOADER_MAGIC   0x2BADB002
 

Definition at line 45 of file boot.h.

#define NULL   0
 

Definition at line 38 of file types.h.

Referenced by _btree_insert(), _btree_remove(), _rwlock_read_lock_timeout(), _slab_reclaim(), _waitq_wakeup_unsafe(), acpi_init(), anon_share(), as_area_create(), btree_init(), btree_insert(), btree_leaf_node_left_neighbour(), btree_leaf_node_right_neighbour(), btree_search(), buddy_system_alloc(), check_area_conflicts(), clock_counter_init(), cmdtab_compl(), code_from_uspace(), cpu_arch_init(), ega_init(), elf_share(), fb_init(), find_best_thread(), find_free_zone_lock(), find_zone_and_lock(), frame_alloc_generic(), frame_free(), frame_reference_add(), futex_find(), get_call(), get_full_current_mag(), get_mag_from_cache(), get_symbol_addr(), i8042_init(), ipc_init(), ipc_irq_cleanup(), ipc_irq_make_table(), ipc_irq_register(), ipc_irq_unregister(), ipc_phone_init(), ipc_wait_for_call(), kcpulb(), kinit(), klog_init(), kmp(), ktaskclnp(), ktaskgc(), let_others_in(), link_initialize(), magazine_destroy(), magazine_obj_get(), main_bsp_separated_stack(), make_empty_current_mag(), mps_init(), node_initialize(), parse_argument(), parse_cmdline(), print_string(), printf_putstr(), pt_mapping_find(), rotate_from_left(), rotate_from_right(), scheduler(), scheduler_separated_stack(), slab_alloc(), slab_cache_init(), slab_free(), slab_obj_create(), slab_space_alloc(), smp_irq_to_pin(), sys_as_area_create(), sys_ipc_answer(), sys_ipc_answer_fast(), sys_sysinfo_valid(), sys_sysinfo_value(), sysinfo_create_path(), sysinfo_dump(), sysinfo_find_item(), sysinfo_get_val(), sysinfo_set_item_function(), sysinfo_set_item_undefined(), sysinfo_set_item_val(), task_create(), task_create_arch(), task_destroy(), task_init(), task_kill(), task_run_program(), the_initialize(), thr_constructor(), thread_create(), thread_destroy(), thread_exists(), thread_init(), timeout_register(), timeout_reinitialize(), uinit(), vprintf(), waitq_interrupt_sleep(), waitq_timeouted_sleep(), zone_buddy_find_block(), zone_buddy_find_buddy(), zone_print_list(), and zone_print_one().

#define NULL_DES   0
 

Definition at line 43 of file pm.h.

#define PIC_ICW1   (1<<4)
 

Definition at line 47 of file i8259.h.

Referenced by i8259_init().

#define PIC_NEEDICW4   (1<<0)
 

Definition at line 46 of file i8259.h.

Referenced by i8259_init().

#define PIC_PIC0PORT1   0x20
 

Definition at line 41 of file i8259.h.

Referenced by i8259_init().

#define PIC_PIC0PORT2   0x21
 

Definition at line 42 of file i8259.h.

Referenced by i8259_init(), pic_disable_irqs(), and pic_enable_irqs().

#define PIC_PIC1PORT1   0xa0
 

Definition at line 43 of file i8259.h.

Referenced by i8259_init().

#define PIC_PIC1PORT2   0xa1
 

Definition at line 44 of file i8259.h.

Referenced by i8259_init(), pic_disable_irqs(), and pic_enable_irqs().

#define PL_KERNEL   0
 

Definition at line 63 of file pm.h.

#define PL_USER   3
 

Definition at line 64 of file pm.h.

Referenced by userspace().

#define POLARITY_HIGH   0x0
 

Interrupt Input Pin Polarities.

Definition at line 79 of file apic.h.

Referenced by io_apic_change_ioredtbl().

#define POLARITY_LOW   0x1
 

Definition at line 80 of file apic.h.

 
#define read_barrier  )     cpuid_serialization()
 

Definition at line 79 of file barrier.h.

#define ROW   80
 

Definition at line 39 of file ega.h.

Referenced by ega_check_cursor(), ega_init(), and ega_putchar().

#define ROWS   25
 

Definition at line 40 of file ega.h.

Referenced by ega_init().

#define SCREEN   (ROW * ROWS)
 

Definition at line 41 of file ega.h.

Referenced by ega_check_cursor(), and ega_init().

#define selector des   )     ((des)<<3)
 

Definition at line 61 of file pm.h.

Referenced by before_thread_runs_arch(), idt_init(), io_perm_bitmap_install(), pm_init(), and userspace().

#define SHIFT   11
 

Definition at line 80 of file i8254.c.

Referenced by i8254_calibrate_delay_loop().

#define SHORTHAND_ALL_EXCL   0x3
 

Definition at line 76 of file apic.h.

Referenced by l_apic_broadcast_custom_ipi().

#define SHORTHAND_ALL_INCL   0x2
 

Definition at line 75 of file apic.h.

Referenced by l_apic_init().

#define SHORTHAND_NONE   0x0
 

Destination Shorthands.

Definition at line 73 of file apic.h.

Referenced by l_apic_send_init_ipi().

#define SHORTHAND_SELF   0x1
 

Definition at line 74 of file apic.h.

#define SP_DELTA   (8+STACK_ITEM_SIZE)
 

Definition at line 48 of file context.h.

Referenced by before_thread_runs_arch().

#define STACK_ITEM_SIZE   4
 

Definition at line 40 of file context.h.

#define SVR   (0x0f0/sizeof(__u32))
 

Spurious-Interrupt Vector Register.

Definition at line 170 of file apic.h.

Referenced by l_apic_init().

#define TDCR   (0x3e0/sizeof(__u32))
 

Time Divide Configuration Register.

Definition at line 183 of file apic.h.

Referenced by l_apic_init().

#define TIMER_ONESHOT   0x0
 

Timer Modes.

Definition at line 93 of file apic.h.

#define TIMER_PERIODIC   0x1
 

Definition at line 94 of file apic.h.

Referenced by l_apic_init().

#define TLS_DES   6
 

Definition at line 49 of file pm.h.

Referenced by set_tls_desc(), and userspace().

#define TPR   (0x080/sizeof(__u32))
 

Definition at line 159 of file apic.h.

Referenced by l_apic_init().

#define TRIGMOD_EDGE   0x0
 

Trigger Modes.

Definition at line 65 of file apic.h.

Referenced by io_apic_change_ioredtbl().

#define TRIGMOD_LEVEL   0x1
 

Definition at line 66 of file apic.h.

Referenced by l_apic_broadcast_custom_ipi(), l_apic_init(), and l_apic_send_init_ipi().

#define TSS_BASIC_SIZE   104
 

Definition at line 76 of file pm.h.

Referenced by io_perm_bitmap_install(), and pm_init().

#define TSS_DES   5
 

Definition at line 48 of file pm.h.

Referenced by io_perm_bitmap_install(), and pm_init().

#define TSS_IOMAP_SIZE   (16*1024+1)
 

Definition at line 77 of file pm.h.

Referenced by io_perm_bitmap_install().

#define UDATA_DES   4
 

Definition at line 47 of file pm.h.

Referenced by userspace().

#define UTEXT_DES   3
 

Definition at line 46 of file pm.h.

Referenced by userspace().

#define VESA_INIT_SEGMENT   0x8000
 

Definition at line 41 of file pm.h.

#define VIDEORAM   0xb8000
 

Definition at line 38 of file ega.h.

Referenced by ega_init().

 
#define write_barrier  )     __asm__ volatile( "" ::: "memory");
 

Definition at line 83 of file barrier.h.

Referenced by clock_update_counters().


Typedef Documentation

typedef __u32 __address
 

Definition at line 50 of file types.h.

typedef __u32 __native
 

Definition at line 55 of file types.h.

typedef signed short __s16
 

Definition at line 41 of file types.h.

typedef signed long __s32
 

Definition at line 42 of file types.h.

typedef signed long long __s64
 

Definition at line 43 of file types.h.

typedef signed char __s8
 

Definition at line 40 of file types.h.

typedef __s32 __snative
 

Definition at line 56 of file types.h.

typedef unsigned short __u16
 

Definition at line 46 of file types.h.

typedef unsigned long __u32
 

Definition at line 47 of file types.h.

typedef unsigned long long __u64
 

Definition at line 48 of file types.h.

typedef unsigned char __u8
 

Definition at line 45 of file types.h.

typedef struct descriptor descriptor_t
 

Definition at line 105 of file pm.h.

typedef union dfr dfr_t
 

Definition at line 287 of file apic.h.

typedef union esr esr_t
 

Definition at line 156 of file apic.h.

typedef void(* fpu_context_function)(fpu_context_t *fctx)
 

Definition at line 40 of file fpu_context.c.

typedef struct icr icr_t
 

Definition at line 134 of file apic.h.

typedef struct idescriptor idescriptor_t
 

Definition at line 114 of file pm.h.

typedef union io_apic_id io_apic_id_t
 

Definition at line 345 of file apic.h.

typedef struct io_redirection_reg io_redirection_reg_t
 

Definition at line 333 of file apic.h.

typedef union io_regsel io_regsel_t
 

Definition at line 306 of file apic.h.

typedef __u32 ipl_t
 

Definition at line 53 of file types.h.

typedef union l_apic_id l_apic_id_t
 

Definition at line 258 of file apic.h.

typedef union ldr ldr_t
 

Definition at line 276 of file apic.h.

typedef union lvt_error lvt_error_t
 

Definition at line 247 of file apic.h.

typedef union lvt_lint lvt_lint_t
 

Definition at line 232 of file apic.h.

typedef union lvt_tm lvt_tm_t
 

Definition at line 213 of file apic.h.

typedef __u32 pfn_t
 

Definition at line 51 of file types.h.

typedef struct page_specifier pte_t
 

Definition at line 58 of file types.h.

typedef struct ptr_16_32 ptr_16_32_t
 

Definition at line 91 of file pm.h.

typedef union svr svr_t
 

Definition at line 180 of file apic.h.

typedef union tdcr tdcr_t
 

Definition at line 191 of file apic.h.

typedef union tpr tpr_t
 

Definition at line 167 of file apic.h.

typedef struct tss tss_t
 

Definition at line 157 of file pm.h.


Enumeration Type Documentation

enum vendor
 

Enumerator:
VendorUnknown 
VendorAMD 
VendorIntel 

Definition at line 60 of file cpu.c.


Function Documentation

void ap_boot void   ) 
 

Referenced by kmp(), and l_apic_send_init_ipi().

void apic_init void   ) 
 

Initialize APIC on BSP.

Definition at line 125 of file apic.c.

References apic_spurious(), DEST_ALL, disable_irqs_function, enable_irqs_function, eoi_function, exc_register(), io_apic_change_ioredtbl(), io_apic_disable_irqs(), io_apic_enable_irqs(), IRQ_COUNT, IVT_IRQBASE, l_apic_eoi(), l_apic_timer_interrupt(), LOPRI, smp_irq_to_pin(), VECTOR_APIC_SPUR, and VECTOR_CLK.

Referenced by kmp().

Here is the call graph for this function:

int apic_poll_errors void   )  [static]
 

Poll for APIC errors.

Examine Error Status Register and report all errors found.

Returns:
0 on error, 1 on success.

Definition at line 191 of file apic.c.

References esr::err_bitmap, ESR, esr::illegal_register_address, l_apic, printf(), esr::receive_accept_error, esr::receive_checksum_error, esr::received_illegal_vector, esr::send_accept_error, esr::send_checksum_error, esr::send_illegal_vector, and esr::value.

Referenced by l_apic_broadcast_custom_ipi(), and l_apic_send_init_ipi().

Here is the call graph for this function:

void apic_spurious int  n,
istate_t istate
[static]
 

APIC spurious interrupt handler.

Parameters:
n Interrupt vector.
istate Interrupted state.

Definition at line 178 of file apic.c.

References CPU, and printf().

Referenced by apic_init().

Here is the call graph for this function:

void arch_grab_console void   ) 
 

Acquire console back for kernel

Definition at line 146 of file ia32.c.

References i8042_grab().

Referenced by sys_debug_enable_console().

Here is the call graph for this function:

void arch_post_mm_init void   ) 
 

Definition at line 83 of file ia32.c.

References config, config_t::cpu_active, ega_init(), vesa_init(), vesa_present(), and zone_merge_all().

Referenced by main_ap(), and main_bsp_separated_stack().

Here is the call graph for this function:

void arch_post_smp_init void   ) 
 

Definition at line 113 of file ia32.c.

References i8042_init().

Here is the call graph for this function:

void arch_pre_mm_init void   ) 
 

Definition at line 65 of file ia32.c.

References bios_init(), config, config_t::cpu_active, exc_register(), i8254_init(), i8259_init(), pm_init(), syscall(), tlb_shootdown_ipi(), VECTOR_SYSCALL, and VECTOR_TLB_SHOOTDOWN_IPI.

Referenced by main_ap(), and main_bsp_separated_stack().

Here is the call graph for this function:

void arch_pre_smp_init void   ) 
 

Definition at line 102 of file ia32.c.

References acpi_init(), config, config_t::cpu_active, and memory_print_map().

Referenced by main_bsp_separated_stack().

Here is the call graph for this function:

void arch_release_console void   ) 
 

Return console to userspace

Definition at line 153 of file ia32.c.

References i8042_release().

Referenced by cmd_continue().

Here is the call graph for this function:

void asm_delay_loop __u32  t  ) 
 

Referenced by delay(), and i8254_calibrate_delay_loop().

void asm_fake_loop __u32  t  ) 
 

Referenced by i8254_calibrate_delay_loop().

static void atomic_dec atomic_t val  )  [static]
 

Definition at line 51 of file atomic.h.

References atomic::count.

Referenced by _slab_free(), check_call_limit(), get_mag_from_cache(), ipc_wait_for_call(), kcpulb(), magazine_destroy(), magazine_obj_get(), slab_space_free(), and sys_ipc_wait_for_call().

static void atomic_inc atomic_t val  )  [static]
 

Definition at line 43 of file atomic.h.

References atomic::count.

Referenced by _ipc_call(), ipc_backsend_err(), magazine_obj_put(), put_mag_to_cache(), slab_alloc(), slab_space_alloc(), and thread_ready().

static void atomic_lock_arch atomic_t val  )  [static]
 

ia32 specific fast spinlock

Definition at line 99 of file atomic.h.

References atomic::count, CS_ENTER_BARRIER, and preemption_disable().

Here is the call graph for this function:

static long atomic_postdec atomic_t val  )  [static]
 

Definition at line 71 of file atomic.h.

References atomic::count.

static long atomic_postinc atomic_t val  )  [static]
 

Definition at line 59 of file atomic.h.

References atomic::count.

void bios_init void   ) 
 

Definition at line 40 of file bios.c.

References BIOS_EBDA_PTR, and ebda.

Referenced by arch_pre_mm_init().

void calibrate_delay_loop void   ) 
 

Definition at line 118 of file ia32.c.

References config, config_t::cpu_active, i8254_calibrate_delay_loop(), and i8254_normal_operation().

Referenced by main_ap(), and main_bsp_separated_stack().

Here is the call graph for this function:

static void clean_AM_flag void   )  [static]
 

Definition at line 166 of file pm.c.

Referenced by pm_init().

static void clean_IOPL_NT_flags void   )  [static]
 

Definition at line 153 of file pm.c.

Referenced by pm_init().

int configure_via_ct void   ) 
 

Definition at line 211 of file mps.c.

References mps_ct::base_table, bus_entries, bus_entry_cnt, ct, ct_bus_entry(), ct_io_apic_entry(), ct_io_intr_entry(), ct_l_intr_entry(), ct_processor_entry(), CT_SIGNATURE, mps_ct::entry_count, io_apic_entries, io_apic_entry_cnt, io_intr_entries, io_intr_entry_cnt, mps_ct::l_apic, l_apic, l_intr_entries, l_intr_entry_cnt, mps_ct_check(), mps_ct::oem_table, printf(), processor_entries, processor_entry_cnt, and mps_ct::signature.

Here is the call graph for this function:

int configure_via_default __u8  n  ) 
 

Definition at line 292 of file mps.c.

References printf().

Here is the call graph for this function:

void cpu_arch_init void   ) 
 

Definition at line 96 of file cpu.c.

References cpuid_feature_info::bits, CPU, cpuid(), CR4_OSFXSR_MASK, fpu_fsr(), fpu_fxsr(), __cpuid_feature_info::fxsr, info, NULL, __cpuid_feature_info::sse, tss_p, cpuid_extended_feature_info::word, and cpuid_feature_info::word.

Here is the call graph for this function:

static void cpu_halt void   )  [static]
 

Halt CPU

Halt the current CPU until interrupt event.

Definition at line 60 of file asm.h.

Referenced by _getc(), and halt().

void cpu_identify void   ) 
 

Definition at line 129 of file cpu.c.

References AMD_CPUID_EBX, AMD_CPUID_ECX, AMD_CPUID_EDX, CPU, cpuid(), has_cpuid(), info, INTEL_CPUID_EBX, INTEL_CPUID_ECX, INTEL_CPUID_EDX, VendorAMD, VendorIntel, and VendorUnknown.

Here is the call graph for this function:

void cpu_print_report cpu_t m  ) 
 

Definition at line 158 of file cpu.c.

References cpu::arch, cpu_arch::family, cpu::frequency_mhz, cpu::id, cpu_arch::model, printf(), cpu_arch::stepping, cpu_arch::vendor, and vendor_str.

Referenced by cpu_list().

Here is the call graph for this function:

static void cpu_sleep void   )  [static]
 

Definition at line 61 of file asm.h.

Referenced by find_best_thread().

static void cpuid __u32  cmd,
struct cpu_info info
[static]
 

Definition at line 100 of file cpuid.h.

References info.

Referenced by cpu_arch_init(), and cpu_identify().

static void cpuid_serialization void   )  [static]
 

Definition at line 52 of file barrier.h.

void ct_bus_entry struct __bus_entry bus  ) 
 

Definition at line 314 of file mps.c.

References __bus_entry::bus_id, __bus_entry::bus_type, memcpy(), and printf().

Referenced by configure_via_ct().

Here is the call graph for this function:

void ct_extended_entries void   ) 
 

Definition at line 405 of file mps.c.

References mps_ct::base_table_length, ct, CT_EXT_ENTRY_LEN, CT_EXT_ENTRY_TYPE, mps_ct::ext_table_length, and printf().

Here is the call graph for this function:

void ct_io_apic_entry struct __io_apic_entry ioa  ) 
 

Definition at line 324 of file mps.c.

References __io_apic_entry::io_apic, io_apic, and __io_apic_entry::io_apic_flags.

Referenced by configure_via_ct().

void ct_io_intr_entry struct __io_intr_entry iointr  ) 
 

Definition at line 343 of file mps.c.

References __io_intr_entry::dst_io_apic_id, __io_intr_entry::dst_io_apic_pin, __io_intr_entry::intr_type, __io_intr_entry::poel, printf(), putchar(), __io_intr_entry::src_bus_id, and __io_intr_entry::src_bus_irq.

Referenced by configure_via_ct().

Here is the call graph for this function:

void ct_l_intr_entry struct __l_intr_entry lintr  ) 
 

Definition at line 374 of file mps.c.

References __l_intr_entry::dst_l_apic_id, __l_intr_entry::dst_l_apic_pin, __l_intr_entry::intr_type, __l_intr_entry::poel, printf(), putchar(), __l_intr_entry::src_bus_id, and __l_intr_entry::src_bus_irq.

Referenced by configure_via_ct().

Here is the call graph for this function:

int ct_processor_entry struct __processor_entry pr  ) 
 

Definition at line 302 of file mps.c.

References apic_id_mask, __processor_entry::cpu_flags, and __processor_entry::l_apic_id.

Referenced by configure_via_ct().

static void ega_check_cursor void   )  [static]
 

Definition at line 99 of file ega.c.

References ega_cursor, memcpy(), memsetw(), ROW, SCREEN, and videoram.

Referenced by ega_putchar().

Here is the call graph for this function:

static void ega_display_char char  ch  )  [static]
 

Definition at line 91 of file ega.c.

References ega_cursor, and videoram.

Referenced by ega_putchar().

void ega_init void   ) 
 

Definition at line 66 of file ega.c.

References chardev_initialize(), ega_console, ega_cursor, ega_ops, hw_map(), inb(), NULL, outb(), putchar(), ROW, ROWS, SCREEN, stdout, sysinfo_set_item_val(), VIDEORAM, and videoram.

Referenced by arch_post_mm_init().

Here is the call graph for this function:

void ega_move_cursor void   ) 
 

Definition at line 139 of file ega.c.

References ega_cursor, and outb().

Referenced by ega_putchar().

Here is the call graph for this function:

void ega_putchar chardev_t d,
const char  ch
[static]
 

Definition at line 109 of file ega.c.

References ega_check_cursor(), ega_cursor, ega_display_char(), ega_move_cursor(), interrupts_disable(), interrupts_restore(), ROW, spinlock_lock, and spinlock_unlock().

Here is the call graph for this function:

void enable_l_apic_in_msr void   ) 
 

Referenced by l_apic_init().

static void fpu_context_f_restore fpu_context_t fctx  )  [static]
 

Definition at line 54 of file fpu_context.c.

Referenced by fpu_fsr().

static void fpu_context_f_save fpu_context_t fctx  )  [static]
 

Definition at line 46 of file fpu_context.c.

Referenced by fpu_fsr().

static void fpu_context_fx_restore fpu_context_t fctx  )  [static]
 

Definition at line 70 of file fpu_context.c.

Referenced by fpu_fxsr().

static void fpu_context_fx_save fpu_context_t fctx  )  [static]
 

Definition at line 62 of file fpu_context.c.

Referenced by fpu_fxsr().

void fpu_context_restore fpu_context_t fctx  ) 
 

Definition at line 102 of file fpu_context.c.

References fpu_restore.

Referenced by before_thread_runs().

void fpu_context_save fpu_context_t fctx  ) 
 

Definition at line 97 of file fpu_context.c.

References fpu_save.

Referenced by scheduler().

void fpu_disable void   ) 
 

Definition at line 72 of file cpu.c.

Referenced by before_thread_runs().

void fpu_enable void   ) 
 

Definition at line 84 of file cpu.c.

Referenced by before_thread_runs().

void fpu_fsr void   ) 
 

Definition at line 89 of file fpu_context.c.

References fpu_context_f_restore(), fpu_context_f_save(), fpu_restore, and fpu_save.

Referenced by cpu_arch_init().

Here is the call graph for this function:

void fpu_fxsr void   ) 
 

Definition at line 81 of file fpu_context.c.

References fpu_context_fx_restore(), fpu_context_fx_save(), fpu_restore, and fpu_save.

Referenced by cpu_arch_init().

Here is the call graph for this function:

void fpu_init void   ) 
 

Definition at line 109 of file fpu_context.c.

Referenced by before_thread_runs().

void gdt_setbase descriptor_t d,
__address  base
 

Definition at line 92 of file pm.c.

References descriptor::base_0_15, descriptor::base_16_23, and descriptor::base_24_31.

Referenced by pm_init(), and set_tls_desc().

void gdt_setlimit descriptor_t d,
__u32  limit
 

Definition at line 99 of file pm.c.

References descriptor::limit_0_15, and descriptor::limit_16_19.

Referenced by io_perm_bitmap_install(), and pm_init().

static void gdtr_load ptr_16_32_t gdtr_reg  )  [static]
 

Load GDTR register from memory.

Parameters:
gdtr_reg Address of memory from where to load GDTR.

Definition at line 265 of file asm.h.

Referenced by io_perm_bitmap_install(), pm_init(), and set_tls_desc().

static void gdtr_store ptr_16_32_t gdtr_reg  )  [static]
 

Store GDTR register to memory.

Parameters:
gdtr_reg Address of memory to where to load GDTR.

Definition at line 274 of file asm.h.

Referenced by io_perm_bitmap_install(), and set_tls_desc().

GEN_READ_REG dr7   ) 
 

GEN_READ_REG dr6   ) 
 

GEN_READ_REG dr3   ) 
 

GEN_READ_REG dr2   ) 
 

GEN_READ_REG dr1   ) 
 

GEN_READ_REG dr0   ) 
 

GEN_READ_REG cr3   ) 
 

GEN_READ_REG cr2   ) 
 

GEN_READ_REG cr0   ) 
 

GEN_WRITE_REG dr7   ) 
 

GEN_WRITE_REG dr6   ) 
 

GEN_WRITE_REG dr3   ) 
 

GEN_WRITE_REG dr2   ) 
 

GEN_WRITE_REG dr1   ) 
 

GEN_WRITE_REG dr0   ) 
 

GEN_WRITE_REG cr3   ) 
 

__u8 get_cpu_apic_id index_t  i  )  [static]
 

Definition at line 123 of file mps.c.

References ASSERT, __processor_entry::l_apic_id, processor_entries, and processor_entry_cnt.

count_t get_cpu_count void   )  [static]
 

Definition at line 106 of file mps.c.

References processor_entry_cnt.

static __address* get_ip  )  [static]
 

Return current IP address

Definition at line 241 of file asm.h.

static __address get_stack_base void   )  [static]
 

Return base address of current stack

Return the base address of the current stack. The stack is assumed to be STACK_SIZE bytes long. The stack must start on page boundary.

Definition at line 222 of file asm.h.

References STACK_SIZE.

static __u32 has_cpuid void   )  [static]
 

Definition at line 75 of file cpuid.h.

Referenced by cpu_identify().

static void i8042_command_write __u8  command  )  [static]
 

Definition at line 63 of file i8042.h.

References i8042_STATUS, and outb().

Referenced by i8042_grab().

Here is the call graph for this function:

static __u8 i8042_data_read void   )  [static]
 

Definition at line 53 of file i8042.h.

References i8042_DATA, and inb().

Referenced by i8042_init(), i8042_interrupt(), i8042_poll(), and key_read().

Here is the call graph for this function:

static void i8042_data_write __u8  data  )  [static]
 

Definition at line 48 of file i8042.h.

References i8042_DATA, and outb().

Referenced by i8042_grab().

Here is the call graph for this function:

static __u8 i8042_status_read void   )  [static]
 

Definition at line 58 of file i8042.h.

References i8042_STATUS, and inb().

Referenced by i8042_init(), i8042_poll(), i8042_wait(), and key_read().

Here is the call graph for this function:

void i8254_calibrate_delay_loop void   ) 
 

Definition at line 81 of file i8254.c.

References asm_delay_loop(), asm_fake_loop(), CLK_PORT1, CLK_PORT4, CPU, delay(), inb(), LOOPS, MAGIC_NUMBER, outb(), rdtsc(), and SHIFT.

Referenced by calibrate_delay_loop().

Here is the call graph for this function:

void i8254_init void   ) 
 

Definition at line 64 of file i8254.c.

References i8254_normal_operation().

Referenced by arch_pre_mm_init().

Here is the call graph for this function:

void i8254_interrupt int  n,
istate_t istate
[static]
 

Definition at line 134 of file i8254.c.

References clock(), and trap_virtual_eoi().

Referenced by i8254_normal_operation().

Here is the call graph for this function:

void i8254_normal_operation void   ) 
 

Definition at line 69 of file i8254.c.

References CLK_CONST, CLK_PORT1, CLK_PORT4, exc_register(), HZ, i8254_interrupt(), IRQ_CLK, outb(), pic_disable_irqs(), pic_enable_irqs(), and VECTOR_CLK.

Referenced by calibrate_delay_loop(), and i8254_init().

Here is the call graph for this function:

void i8259_init void   ) 
 

Definition at line 50 of file i8259.c.

References disable_irqs_function, enable_irqs_function, eoi_function, exc_register(), IRQ_PIC1, IVT_IRQBASE, outb(), pic_disable_irqs(), pic_enable_irqs(), pic_eoi(), PIC_ICW1, PIC_NEEDICW4, PIC_PIC0PORT1, PIC_PIC0PORT2, PIC_PIC1PORT1, PIC_PIC1PORT2, pic_spurious(), and VECTOR_PIC_SPUR.

Referenced by arch_pre_mm_init().

Here is the call graph for this function:

void idt_init void   ) 
 

Definition at line 122 of file pm.c.

References idescriptor::access, AR_INTERRUPT, AR_PRESENT, DPL_USER, exc_register(), idt, IDT_ITEMS, idt_setoffset(), interrupt_handler_size, interrupt_handlers(), KTEXT_DES, null_interrupt(), selector, idescriptor::selector, idescriptor::unused, and VECTOR_SYSCALL.

Referenced by pm_init().

Here is the call graph for this function:

void idt_setoffset idescriptor_t d,
__address  offset
 

Definition at line 105 of file pm.c.

References idescriptor::offset_0_15, and idescriptor::offset_16_31.

Referenced by idt_init().

static void idtr_load ptr_16_32_t idtr_reg  )  [static]
 

Load IDTR register from memory.

Parameters:
idtr_reg Address of memory from where to load IDTR.

Definition at line 283 of file asm.h.

Referenced by pm_init().

static __u8 inb __u16  port  )  [static]
 

Byte from port

Get byte from port

Parameters:
port Port to read from
Returns:
Value read

Definition at line 128 of file asm.h.

Referenced by code_execute(), ega_init(), i8042_data_read(), i8042_status_read(), i8254_calibrate_delay_loop(), pic_disable_irqs(), and pic_enable_irqs().

static __u32 inl __u16  port  )  [static]
 

Double word from port

Get double word from port

Parameters:
port Port to read from
Returns:
Value read

Definition at line 146 of file asm.h.

void interrupt_handlers void   ) 
 

Referenced by idt_init().

static ipl_t interrupts_disable void   )  [static]
 

Disable interrupts.

Disable interrupts and return previous value of EFLAGS.

Returns:
Old interrupt priority level.

Definition at line 174 of file asm.h.

static ipl_t interrupts_enable void   )  [static]
 

Enable interrupts.

Enable interrupts and return previous value of EFLAGS.

Returns:
Old interrupt priority level.

Definition at line 155 of file asm.h.

static ipl_t interrupts_read void   )  [static]
 

Return interrupt priority level.

Returns:
EFLAFS.

Definition at line 205 of file asm.h.

static void interrupts_restore ipl_t  ipl  )  [static]
 

Restore interrupt priority level.

Restore EFLAGS.

Parameters:
ipl Saved interrupt priority level.

Definition at line 192 of file asm.h.

static void invlpg __address  addr  )  [static]
 

Invalidate TLB Entry.

Parameters:
addr Address on a page whose TLB entry is to be invalidated.

Definition at line 256 of file asm.h.

Referenced by tlb_invalidate_pages().

static __u16 inw __u16  port  )  [static]
 

Word from port

Get word from port

Parameters:
port Port to read from
Returns:
Value read

Definition at line 137 of file asm.h.

void io_apic_change_ioredtbl int  pin,
int  dest,
__u8  v,
int  flags
 

Change some attributes of one item in I/O Redirection Table.

Parameters:
pin IO APIC pin number.
dest Interrupt destination address.
v Interrupt vector to trigger.
flags Flags.

Definition at line 504 of file apic.c.

References io_redirection_reg::delmod, DELMOD_FIXED, DELMOD_LOWPRI, io_redirection_reg::dest, io_redirection_reg::destmod, DESTMOD_LOGIC, io_redirection_reg::hi, io_redirection_reg::intpol, io_redirection_reg::intvec, io_apic_read(), io_apic_write(), IOREDTBL, io_redirection_reg::lo, LOPRI, POLARITY_HIGH, io_redirection_reg::trigger_mode, and TRIGMOD_EDGE.

Referenced by apic_init().

Here is the call graph for this function:

void io_apic_disable_irqs __u16  irqmask  ) 
 

Mask IRQs in IO APIC.

Parameters:
irqmask Bitmask of IRQs to be masked (0 = do not mask, 1 = mask).

Definition at line 530 of file apic.c.

References io_apic_read(), io_apic_write(), IOREDTBL, io_redirection_reg::lo, io_redirection_reg::masked, and smp_irq_to_pin().

Referenced by apic_init().

Here is the call graph for this function:

void io_apic_enable_irqs __u16  irqmask  ) 
 

Unmask IRQs in IO APIC.

Parameters:
irqmask Bitmask of IRQs to be unmasked (0 = do not unmask, 1 = unmask).

Definition at line 556 of file apic.c.

References io_apic_read(), io_apic_write(), IOREDTBL, io_redirection_reg::lo, io_redirection_reg::masked, and smp_irq_to_pin().

Referenced by apic_init().

Here is the call graph for this function:

__u32 io_apic_read __u8  address  ) 
 

Read from IO APIC register.

Parameters:
address IO APIC register address.
Returns:
Content of the addressed IO APIC register.

Definition at line 472 of file apic.c.

References io_apic, IOREGSEL, IOWIN, io_regsel::reg_addr, and io_regsel::value.

Referenced by io_apic_change_ioredtbl(), io_apic_disable_irqs(), and io_apic_enable_irqs().

void io_apic_write __u8  address,
__u32  x
 

Write to IO APIC register.

Parameters:
address IO APIC register address.
x Content to be written to the addressed IO APIC register.

Definition at line 487 of file apic.c.

References io_apic, IOREGSEL, IOWIN, io_regsel::reg_addr, and io_regsel::value.

Referenced by io_apic_change_ioredtbl(), io_apic_disable_irqs(), and io_apic_enable_irqs().

void ipi_broadcast_arch int  ipi  ) 
 

Definition at line 40 of file ipi.c.

References l_apic_broadcast_custom_ipi().

Referenced by ipi_broadcast().

Here is the call graph for this function:

bool is_bsp index_t  i  )  [static]
 

Definition at line 117 of file mps.c.

References ASSERT, __processor_entry::cpu_flags, processor_entries, and processor_entry_cnt.

bool is_cpu_enabled index_t  i  )  [static]
 

Definition at line 111 of file mps.c.

References ASSERT, __processor_entry::cpu_flags, processor_entries, and processor_entry_cnt.

void kmp void *  arg  ) 
 

Definition at line 102 of file smp.c.

References ap_boot(), ap_completion_wq, apic_init(), ASSERT, l_apic_id(), NULL, ops, outb(), pic_disable_irqs(), printf(), and waitq_initialize().

Referenced by kinit().

Here is the call graph for this function:

int l_apic_broadcast_custom_ipi __u8  vector  ) 
 

Send all CPUs excluding CPU IPI vector.

Parameters:
vector Interrupt vector to be sent.
Returns:
0 on failure, 1 on success.

Definition at line 221 of file apic.c.

References apic_poll_errors(), icr::delivs, DELIVS_PENDING, icr::delmod, DELMOD_FIXED, icr::destmod, DESTMOD_LOGIC, ICRlo, l_apic, icr::level, LEVEL_ASSERT, icr::lo, printf(), icr::shorthand, SHORTHAND_ALL_EXCL, icr::trigger_mode, TRIGMOD_LEVEL, and icr::vector.

Referenced by ipi_broadcast_arch().

Here is the call graph for this function:

void l_apic_debug void   ) 
 

Dump content of Local APIC registers.

Definition at line 423 of file apic.c.

References CPU, lvt_error::delivs, lvt_lint::delivs, lvt_tm::delivs, lvt_lint::delmod, lvt_lint::intpol, lvt_lint::irr, l_apic, LVT_Err, LVT_LINT0, LVT_LINT1, LVT_Tm, lvt_error::masked, lvt_lint::masked, lvt_tm::masked, lvt_tm::mode, printf(), lvt_lint::trigger_mode, lvt_error::value, lvt_lint::value, lvt_tm::value, lvt_error::vector, and lvt_tm::vector.

Referenced by main_ap().

Here is the call graph for this function:

void l_apic_eoi void   ) 
 

Local APIC End of Interrupt.

Definition at line 417 of file apic.c.

References EOI, and l_apic.

Referenced by apic_init(), and l_apic_timer_interrupt().

__u8 l_apic_id void   ) 
 

Get Local APIC ID.

Returns:
Local APIC ID.

Definition at line 458 of file apic.c.

References l_apic_id::apic_id, l_apic, L_APIC_ID, and l_apic_id::value.

Referenced by kmp(), and madt_cpu_bootstrap().

void l_apic_init void   ) 
 

Initialize Local APIC.

Definition at line 323 of file apic.c.

References CCRT, CPU, delay(), icr::delmod, DELMOD_INIT, icr::destmod, DESTMOD_PHYS, DFR, tdcr::div_value, DIVIDE_1, enable_l_apic_in_msr(), svr::focus_checking, HZ, ICRlo, ICRT, ldr::id, l_apic, svr::lapic_enabled, LDR, icr::level, LEVEL_DEASSERT, icr::lo, LVT_Err, LVT_LINT0, LVT_LINT1, LVT_Tm, lvt_tm::masked, lvt_lint::masked, lvt_error::masked, lvt_tm::mode, dfr::model, MODEL_FLAT, tpr::pri, tpr::pri_sc, icr::shorthand, SHORTHAND_ALL_INCL, SVR, TDCR, TIMER_PERIODIC, TPR, icr::trigger_mode, TRIGMOD_LEVEL, dfr::value, ldr::value, lvt_tm::value, tdcr::value, svr::value, tpr::value, lvt_lint::value, lvt_error::value, lvt_tm::vector, svr::vector, VECTOR_APIC_SPUR, and VECTOR_CLK.

Referenced by main_ap().

Here is the call graph for this function:

int l_apic_send_init_ipi __u8  apicid  ) 
 

Universal Start-up Algorithm for bringing up the AP processors.

Parameters:
apicid APIC ID of the processor to be brought up.
Returns:
0 on failure, 1 on success.

Definition at line 251 of file apic.c.

References ap_boot(), apic_poll_errors(), delay(), icr::delivs, DELIVS_PENDING, icr::delmod, DELMOD_INIT, DELMOD_STARTUP, icr::dest, icr::destmod, DESTMOD_PHYS, icr::hi, ICRhi, ICRlo, is_82489DX_apic, l_apic, LAVR, icr::level, LEVEL_ASSERT, LEVEL_DEASSERT, icr::lo, printf(), icr::shorthand, SHORTHAND_NONE, icr::trigger_mode, TRIGMOD_LEVEL, and icr::vector.

Here is the call graph for this function:

void l_apic_timer_interrupt int  n,
istate_t istate
[static]
 

Local APIC Timer Interrupt.

Parameters:
n Interrupt vector number.
istate Interrupted state.

Definition at line 448 of file apic.c.

References clock(), and l_apic_eoi().

Referenced by apic_init().

Here is the call graph for this function:

static int memcmp const void *  src,
const void *  dst,
size_t  cnt
[static]
 

Compare memory regions for equality

Compare a given number of bytes (3rd argument) at memory locations defined by 1st and 2nd argument for equality. If bytes are equal function returns 0.

Parameters:
src Region 1
dst Region 2
cnt Number of bytes
Returns:
Zero if bytes are equal, non-zero otherwise

Definition at line 86 of file memstr.h.

static void* memcpy void *  dst,
const void *  src,
size_t  cnt
[static]
 

Copy memory

Copy a given number of bytes (3rd argument) from the memory location defined by 2nd argument to the memory location defined by 1st argument. The memory areas cannot overlap.

Parameters:
dst Destination
src Source
cnt Number of bytes
Returns:
Destination

Definition at line 50 of file memstr.h.

Referenced by _bubblesort(), _qsort(), clear_screen(), ct_bus_entry(), ega_check_cursor(), ptl0_create(), scroll_screen(), sys_ipc_answer(), sys_ipc_answer_fast(), thread_create(), and vsnprintf_write().

static void memsetb __address  dst,
size_t  cnt,
__u8  x
[static]
 

Fill memory with bytes Fill a given number of bytes (2nd argument) at memory defined by 1st argument with the word value defined by 3rd argument.

Parameters:
dst Destination
cnt Number of bytes
x Value to fill

Definition at line 135 of file memstr.h.

Referenced by _ipc_call_init(), _slab_cache_create(), anon_page_fault(), as_area_create(), cpu_init(), hash_table_create(), make_magcache(), pt_mapping_insert(), pt_mapping_remove(), ptl0_create(), thread_create(), and tss_initialize().

static void memsetw __address  dst,
size_t  cnt,
__u16  x
[static]
 

Fill memory with words Fill a given number of words (2nd argument) at memory defined by 1st argument with the word value defined by 3rd argument.

Parameters:
dst Destination
cnt Number of words
x Value to fill

Definition at line 113 of file memstr.h.

Referenced by ega_check_cursor().

int mps_ct_check void   ) 
 

Definition at line 147 of file mps.c.

References mps_ct::base_table_length, ct, mps_ct::ext_table_checksum, and mps_ct::ext_table_length.

Referenced by configure_via_ct().

int mps_fs_check __u8 base  ) 
 

Definition at line 133 of file mps.c.

Referenced by mps_init().

void mps_init void   ) 
 

Definition at line 168 of file mps.c.

References ebda, fs, FS_SIGNATURE, mps_fs_check(), and NULL.

Referenced by smp_init().

Here is the call graph for this function:

int mps_irq_to_pin int  irq  )  [static]
 

Definition at line 419 of file mps.c.

References __l_intr_entry::intr_type, io_intr_entries, io_intr_entry_cnt, and __l_intr_entry::src_bus_irq.

static void outb __u16  port,
__u8  val
[static]
 

Byte to port

Output byte to port

Parameters:
port Port to write to
val Value to write

Definition at line 101 of file asm.h.

Referenced by code_execute(), ega_init(), ega_move_cursor(), i8042_command_write(), i8042_data_write(), i8254_calibrate_delay_loop(), i8254_normal_operation(), i8259_init(), kmp(), pic_disable_irqs(), pic_enable_irqs(), and pic_eoi().

static void outl __u16  port,
__u32  val
[static]
 

Double word to port

Output double word to port

Parameters:
port Port to write to
val Value to write

Definition at line 119 of file asm.h.

static void outw __u16  port,
__u16  val
[static]
 

Word to port

Output word to port

Parameters:
port Port to write to
val Value to write

Definition at line 110 of file asm.h.

void paging_on void   ) 
 

void pic_disable_irqs __u16  irqmask  ) 
 

Definition at line 107 of file i8259.c.

References inb(), outb(), PIC_PIC0PORT2, and PIC_PIC1PORT2.

Referenced by i8254_normal_operation(), i8259_init(), and kmp().

Here is the call graph for this function:

void pic_enable_irqs __u16  irqmask  ) 
 

Definition at line 93 of file i8259.c.

References inb(), outb(), PIC_PIC0PORT2, and PIC_PIC1PORT2.

Referenced by i8254_normal_operation(), and i8259_init().

Here is the call graph for this function:

void pic_eoi void   ) 
 

Definition at line 121 of file i8259.c.

References outb().

Referenced by i8259_init().

Here is the call graph for this function:

void pic_spurious int  n,
istate_t istate
[static]
 

Definition at line 127 of file i8259.c.

References CPU, and printf().

Referenced by i8259_init().

Here is the call graph for this function:

void pm_init void   ) 
 

Definition at line 176 of file pm.c.

References descriptor::access, AR_PRESENT, AR_TSS, ptr_16_32::base, clean_AM_flag(), clean_IOPL_NT_flags(), config, config_t::cpu_active, DPL_KERNEL, FRAME_ATOMIC, gdt_setbase(), gdt_setlimit(), gdtr, gdtr_load(), descriptor::granularity, idt, idt_init(), idtr_load(), malloc(), panic, selector, descriptor::special, tr_load(), tss, TSS_BASIC_SIZE, TSS_DES, tss_initialize(), and tss_p.

Referenced by arch_pre_mm_init().

Here is the call graph for this function:

static __u64 rdtsc void   )  [static]
 

Definition at line 231 of file asm.h.

Referenced by i8254_calibrate_delay_loop().

void set_tls_desc __address  tls  ) 
 

Definition at line 227 of file pm.c.

References ptr_16_32::base, gdt_setbase(), gdtr_load(), gdtr_store(), and TLS_DES.

Referenced by before_thread_runs_arch(), and sys_tls_set().

Here is the call graph for this function:

void smp_init void   ) 
 

Definition at line 62 of file smp.c.

References acpi_madt_parse(), AS_KERNEL, config, config_t::cpu_count, frame_alloc_rc, FRAME_ATOMIC, FRAME_KA, FRAME_OK, io_apic, l_apic, madt_config_operations, mps_config_operations, mps_init(), ONE_FRAME, ops, page_mapping_insert(), PAGE_NOT_CACHEABLE, panic, and PFN2ADDR().

Referenced by main_bsp_separated_stack().

Here is the call graph for this function:

int smp_irq_to_pin int  irq  ) 
 

Definition at line 176 of file smp.c.

References ASSERT, NULL, and ops.

Referenced by apic_init(), io_apic_disable_irqs(), and io_apic_enable_irqs().

SPINLOCK_INITIALIZE egalock   ) 
 

__native sys_tls_set __native  addr  ) 
 

Set thread-local-storage pointer

TLS pointer is set in GS register. That means, the GS contains selector, and the descriptor->base is the correct address.

Definition at line 135 of file ia32.c.

References set_tls_desc(), and THREAD.

Here is the call graph for this function:

static __u32 test_and_set atomic_t val  )  [static]
 

Definition at line 86 of file atomic.h.

References atomic::count.

Referenced by spinlock_trylock().

static void tr_load __u16  sel  )  [static]
 

Load TR from descriptor table.

Parameters:
sel Selector specifying descriptor of TSS segment.

Definition at line 292 of file asm.h.

Referenced by io_perm_bitmap_install(), and pm_init().

void tss_initialize tss_t t  ) 
 

Definition at line 114 of file pm.c.

References memsetb(), and tss.

Referenced by pm_init().

Here is the call graph for this function:

void userspace uspace_arg_t kernel_uarg  ) 
 

Enter userspace

Change CPU protection level to 3, enter userspace.

Definition at line 48 of file userspace.c.

References interrupts_disable(), PL_USER, selector, THREAD_STACK_SIZE, TLS_DES, UDATA_DES, uspace_arg::uspace_entry, uspace_arg::uspace_stack, uspace_arg::uspace_uarg, and UTEXT_DES.

Referenced by uinit().

Here is the call graph for this function:

void vesa_init void   ) 
 

Referenced by arch_post_mm_init().

int vesa_present void   ) 
 

Referenced by arch_post_mm_init().


Variable Documentation

waitq_t ap_completion_wq
 

Definition at line 87 of file mps.c.

Referenced by kmp(), and main_ap_separated_stack().

waitq_t ap_completion_wq
 

Definition at line 87 of file mps.c.

Referenced by kmp(), and main_ap_separated_stack().

__u32 apic_id_mask = 0
 

Definition at line 73 of file apic.c.

Referenced by ct_processor_entry(), and madt_l_apic_entry().

__u32 apic_id_mask
 

Definition at line 73 of file apic.c.

Referenced by ct_processor_entry(), and madt_l_apic_entry().

ptr_16_32_t bootstrap_gdtr = { .limit = sizeof(gdt), .base = KA2PA((__address) gdt) }
 

Definition at line 89 of file pm.c.

ptr_16_32_t bootstrap_gdtr
 

Definition at line 89 of file pm.c.

struct __bus_entry* bus_entries = NULL
 

Definition at line 76 of file mps.c.

Referenced by configure_via_ct().

int bus_entry_cnt = 0
 

Definition at line 82 of file mps.c.

Referenced by configure_via_ct().

struct mps_ct* ct [static]
 

Definition at line 73 of file mps.c.

Referenced by configure_via_ct(), ct_extended_entries(), and mps_ct_check().

__u32 e801memorysize
 

Size of available memory in KB.

Definition at line 42 of file memory_init.c.

Referenced by get_memory_size().

__u8 e820counter
 

Definition at line 40 of file memory_init.c.

Referenced by cmd_e820mem(), init_e820_memory(), and memory_print_map().

struct e820memmap_ e820table[MEMMAP_E820_MAX_RECORDS]
 

Definition at line 41 of file memory_init.c.

Referenced by cmd_e820mem(), init_e820_memory(), and memory_print_map().

__address ebda = 0
 

Definition at line 38 of file bios.c.

Referenced by acpi_init(), bios_init(), and mps_init().

__address ebda
 

Definition at line 38 of file bios.c.

Referenced by acpi_init(), bios_init(), and mps_init().

chardev_t ega_console
 

Definition at line 59 of file ega.c.

Referenced by ega_init().

__u32 ega_cursor [static]
 

Definition at line 54 of file ega.c.

Referenced by ega_check_cursor(), ega_display_char(), ega_init(), ega_move_cursor(), and ega_putchar().

chardev_operations_t ega_ops [static]
 

Initial value:

 {
        .write = ega_putchar
}

Definition at line 60 of file ega.c.

Referenced by ega_init().

fpu_context_function fpu_restore [static]
 

Definition at line 42 of file fpu_context.c.

Referenced by fpu_context_restore(), fpu_fsr(), and fpu_fxsr().

fpu_context_function fpu_save [static]
 

Definition at line 42 of file fpu_context.c.

Referenced by fpu_context_save(), fpu_fsr(), and fpu_fxsr().

struct mps_fs* fs [static]
 

Definition at line 72 of file mps.c.

Referenced by mps_init().

descriptor_t gdt[GDT_ITEMS]
 

Initial value:

 {
        
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
        
        { 0xffff, 0, 0, AR_PRESENT | AR_CODE | DPL_KERNEL, 0xf, 0, 0, 1, 1, 0 },
        
        { 0xffff, 0, 0, AR_PRESENT | AR_DATA | AR_WRITABLE | DPL_KERNEL, 0xf, 0, 0, 1, 1, 0 },
        
        { 0xffff, 0, 0, AR_PRESENT | AR_CODE | DPL_USER, 0xf, 0, 0, 1, 1, 0 },
        
        { 0xffff, 0, 0, AR_PRESENT | AR_DATA | AR_WRITABLE | DPL_USER, 0xf, 0, 0, 1, 1, 0 },
        
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
        
        { 0xffff, 0, 0, AR_PRESENT | AR_DATA | AR_WRITABLE | DPL_USER, 0xf, 0, 0, 1, 1, 0 },
        


        
}

Definition at line 61 of file pm.c.

descriptor_t gdt[]
 

Definition at line 61 of file pm.c.

ptr_16_32_t gdtr = { .limit = sizeof(gdt), .base = (__address) gdt }
 

Definition at line 90 of file pm.c.

Referenced by pm_init().

ptr_16_32_t gdtr
 

Definition at line 90 of file pm.c.

Referenced by pm_init().

idescriptor_t idt[IDT_ITEMS] [static]
 

Definition at line 82 of file pm.c.

Referenced by idt_init(), and pm_init().

__u32 interrupt_handler_size
 

Referenced by idt_init().

volatile __u32* io_apic = (__u32 *) 0xfec00000
 

Definition at line 71 of file apic.c.

Referenced by ct_io_apic_entry(), io_apic_read(), io_apic_write(), madt_io_apic_entry(), and smp_init().

volatile __u32* io_apic
 

Definition at line 71 of file apic.c.

Referenced by ct_io_apic_entry(), io_apic_read(), io_apic_write(), madt_io_apic_entry(), and smp_init().

struct __io_apic_entry* io_apic_entries = NULL
 

Definition at line 77 of file mps.c.

Referenced by configure_via_ct().

int io_apic_entry_cnt = 0
 

Definition at line 83 of file mps.c.

Referenced by configure_via_ct().

struct __io_intr_entry* io_intr_entries = NULL
 

Definition at line 78 of file mps.c.

Referenced by configure_via_ct(), and mps_irq_to_pin().

int io_intr_entry_cnt = 0
 

Definition at line 84 of file mps.c.

Referenced by configure_via_ct(), and mps_irq_to_pin().

volatile __u32* l_apic = (__u32 *) 0xfee00000
 

Definition at line 70 of file apic.c.

Referenced by acpi_madt_parse(), apic_poll_errors(), configure_via_ct(), l_apic_broadcast_custom_ipi(), l_apic_debug(), l_apic_eoi(), l_apic_id(), l_apic_init(), l_apic_send_init_ipi(), and smp_init().

volatile __u32* l_apic
 

Definition at line 70 of file apic.c.

Referenced by acpi_madt_parse(), apic_poll_errors(), configure_via_ct(), l_apic_broadcast_custom_ipi(), l_apic_debug(), l_apic_eoi(), l_apic_id(), l_apic_init(), l_apic_send_init_ipi(), and smp_init().

struct __l_intr_entry* l_intr_entries = NULL
 

Definition at line 79 of file mps.c.

Referenced by configure_via_ct().

int l_intr_entry_cnt = 0
 

Definition at line 85 of file mps.c.

Referenced by configure_via_ct().

struct smp_config_operations mps_config_operations
 

Initial value:

 {
        .cpu_count = get_cpu_count,
        .cpu_enabled = is_cpu_enabled,
        .cpu_bootstrap = is_bsp,
        .cpu_apic_id = get_cpu_apic_id,
        .irq_to_pin = mps_irq_to_pin
}

Definition at line 98 of file mps.c.

Referenced by smp_init().

struct smp_config_operations mps_config_operations
 

Definition at line 98 of file mps.c.

Referenced by smp_init().

struct smp_config_operations* ops = NULL [static]
 

Definition at line 60 of file smp.c.

struct __l_intr_entry packed
 

struct __io_intr_entry packed
 

struct __io_apic_entry packed
 

struct __bus_entry packed
 

struct __processor_entry packed
 

struct mps_ct packed
 

struct mps_fs packed
 

struct io_redirection_reg packed
 

I/O Redirection Register.

struct icr packed
 

struct tss packed
 

struct idescriptor packed
 

struct descriptor packed
 

struct ptr_16_32 packed
 

struct __cpuid_feature_info packed
 

struct __cpuid_extended_feature_info packed
 

struct cpu_info packed
 

struct context packed
 

struct e820memmap_ packed
 

struct __processor_entry* processor_entries = NULL
 

Definition at line 75 of file mps.c.

Referenced by configure_via_ct(), get_cpu_apic_id(), is_bsp(), and is_cpu_enabled().

int processor_entry_cnt = 0
 

Definition at line 81 of file mps.c.

Referenced by configure_via_ct(), get_cpu_apic_id(), get_cpu_count(), is_bsp(), and is_cpu_enabled().

ptr_16_32_t protected_ap_gdtr
 

tss_t tss [static]
 

Definition at line 84 of file pm.c.

Referenced by pm_init(), and tss_initialize().

tss_t* tss_p = NULL
 

Definition at line 86 of file pm.c.

Referenced by cpu_arch_init(), and pm_init().

struct tss* tss_p
 

Definition at line 86 of file pm.c.

Referenced by cpu_arch_init(), and pm_init().

char* vendor_str[] [static]
 

Initial value:

 {
        "Unknown Vendor",
        "AuthenticAMD",
        "GenuineIntel"
}

Definition at line 66 of file cpu.c.

Referenced by cpu_print_report().

__u8* videoram [static]
 

Definition at line 55 of file ega.c.

Referenced by ega_check_cursor(), ega_display_char(), and ega_init().


Generated on Sun Jun 18 16:50:46 2006 for HelenOS Kernel (ia32) by  doxygen 1.4.6