2009-05-18 10:30:27 +03:00
|
|
|
#pypp 0
|
|
|
|
#ifndef _ARCH_HH
|
|
|
|
#define _ARCH_HH
|
|
|
|
|
2009-05-19 00:18:23 +03:00
|
|
|
#define PAGE_BITS (12)
|
|
|
|
#define PAGE_SIZE (1 << PAGE_BITS)
|
|
|
|
#define PAGE_MASK (~(PAGE_SIZE - 1))
|
|
|
|
|
2009-05-18 10:30:27 +03:00
|
|
|
struct Thread_arch:
|
|
|
|
unsigned at, v0, v1, a0, a1, a2, a3
|
|
|
|
unsigned t0, t1, t2, t3, t4, t5, t6, t7, t8, t9
|
|
|
|
unsigned gp, fp, ra, hi, lo, k0, k1
|
|
|
|
|
|
|
|
struct Memory_arch:
|
|
|
|
unsigned asid
|
2009-05-20 23:07:56 +03:00
|
|
|
unsigned **directory
|
2009-05-19 00:18:23 +03:00
|
|
|
|
2009-05-18 10:30:27 +03:00
|
|
|
EXTERN unsigned g_asid
|
|
|
|
|
|
|
|
// Functions which can be called from assembly must not be mangled.
|
|
|
|
extern "C":
|
|
|
|
// Kernel entry points, called from entry.S.
|
|
|
|
Thread *interrupt (Thread *current)
|
|
|
|
Thread *cache_error (Thread *current)
|
|
|
|
Thread *exception (Thread *current)
|
|
|
|
Thread *tlb_refill (Thread *current, unsigned EntryHi)
|
|
|
|
|
|
|
|
#ifdef INIT
|
|
|
|
// Initialize most things (the rest is done in boot.S)
|
|
|
|
void init ()
|
|
|
|
// Start running the idle task for the first time.
|
|
|
|
void run_idle (Thread *self)
|
|
|
|
#endif
|
|
|
|
|
2009-05-20 23:07:56 +03:00
|
|
|
#endif
|