IBNOS
Macros | Functions | Variables
gdt.c File Reference
#include <hardware/gdt.h>
#include <memory/paging.h>
#include <memory/physmem.h>
#include <console/console.h>
#include <interrupt/interrupt.h>
#include <process/thread.h>
Include dependency graph for gdt.c:

Go to the source code of this file.

Macros

#define INTJMP_ENTRY_SIZE   8
 
#define INTJMP_ENTRY_MASK   7
 
#define INTJMP_ENTRY_BITS   3
 
#define KERNEL_IDLE_BEGIN   ((uint32_t)&__kernelIdleBegin)
 
#define KERNEL_IDLE_END   ((uint32_t)&__kernelIdleEnd)
 
#define __isErrorCodeInterrupt(i)   ((i) == 8 || ((i) >= 10 && (i) <= 14) || (i) == 17)
 

Functions

void __attribute__ ((cdecl))
 
void gdtInit ()
 Initializes the GDT, task registers, and sets up everything required for multiprocessing. More...
 
struct GDTEntrygdtGetFreeEntry ()
 Get a free entry in the GDT. More...
 
uint32_t gdtGetEntryOffset (struct GDTEntry *entry, uint32_t ring)
 Determines the offset of a GDT entry. More...
 
void gdtEntrySetAddress (struct GDTEntry *entry, uint32_t address)
 Helper function to set the address inside a GDTEntry. More...
 
void gdtEntrySetLimit (struct GDTEntry *entry, uint64_t length)
 Helper function to set the length inside a GDTEntry. More...
 
void gdtReleaseEntry (struct GDTEntry *entry)
 Mark a GDTEntry as free. More...
 
uint32_t tssRunUsermodeThread (struct thread *t)
 Run a thread. More...
 

Variables

void * kernelStack
 
void * intJmpTable_kernel
 
void * intJmpTable_user
 
struct GDTEntrycodeRing0
 
struct GDTEntrydataRing0
 
struct GDTEntrycodeRing3
 
struct GDTEntrydataRing3
 
struct GDTEntrykernelTask
 
struct GDTEntryusermodeTask
 
uint32_t __kernelIdleBegin
 
uint32_t __kernelIdleEnd
 

Macro Definition Documentation

◆ __isErrorCodeInterrupt

#define __isErrorCodeInterrupt (   i)    ((i) == 8 || ((i) >= 10 && (i) <= 14) || (i) == 17)