3 * \brief Documentation Definitions for the Acess 2 Architecture Interface
4 * \author John Hodge (thePowersGang)
6 * Acess 2 allows different architecture builds to be made off almost
7 * the same source tree. The difference between the trees is the inclusion
8 * of a different directory from the "Kernel/arch/" directory that
9 * contains the architecture specific intialisation and management code.
10 * Each achitecture tree must provide all the definitions from this
11 * document in some form or another (usually in the most efficient way
13 * The values and types used in this documentation are a guide only and
14 * will most probably be incorrect for most architectures.
20 * \brief Maximum number of CPUs supported by this architecture driver
21 * (in the current build)
25 * \brief Number of bits in a machine word (Uint)
29 * \brief Number of valid bits in a \a tPAddr
34 * \name Syncronisation Primitives
38 * \brief Spinlock type
40 typedef volatile int tSpinlock;
42 * \brief Acquire a spinlock
44 #define LOCK(lockptr) do{while(*(tSpinlock*)lockptr)Threads_Yield();*(tSpinlock*)lockptr=1;}while(0)
46 * \brief Release a held spinlock
48 #define RELEASE(lockptr) do{*(tSpinlock*)lockptr=0;}while(0)
52 //#define HALT() __asm__ __volatile__ ("hlt")
59 typedef unsigned int Uint; //!< Unsigned machine native integer
60 typedef unsigned char Uint8; //!< Unsigned 8-bit integer
61 typedef unsigned short Uint16; //!< Unsigned 16-bit integer
62 typedef unsigned long Uint32; //!< Unsigned 32-bit integer
63 typedef unsigned long long Uint64; //!< Unsigned 64-bit integer
64 typedef signed int Sint; //!< Signed Machine Native integer
65 typedef signed char Sint8; //!< Signed 8-bit integer
66 typedef signed short Sint16; //!< Signed 16-bit integer
67 typedef signed long Sint32; //!< Signed 32-bit integer
68 typedef signed long long Sint64; //!< Signed 16-bit integer
73 typedef Uint size_t; //!< Counter/Byte count type
74 typedef Uint32 tVAddr; //!< Virtual address type
75 typedef Uint32 tPAddr; //!< Physical Address type
78 * \brief Register state passed to the syscall handler
80 * The \a tSyscallRegs structure allows the system call handler to read
81 * the user state to get the arguments for the call. It also allows the
82 * handler to alter specific parts of the user state to reflect the
84 * \note The fields shown here are need only be present in the actual
85 * structure, in any order. The implementation may also add more
86 * fields for padding purposes.
89 Uint Arg4; //!< Fourth argument
90 Uint Arg3; //!< Third argument
91 Uint Arg2; //!< Second argument
93 Uint Arg1; //!< First arugment
94 Uint RetHi; //!< High part of the return
97 Uint Num; //!< Call Number
98 Uint Return; //!< Low return value
101 Uint StackPointer; //!< User stack pointer
105 * \brief Opaque structure definining the MMU state for a task
107 typedef struct sMemoryState tMemoryState;
110 * \brief Opque structure defining the CPU state for a task
112 typedef struct sTaskState tTaskState;
116 * \name Memory Management