-typedef union {
- unsigned int word;
- struct {
- unsigned int htaborg : 16;
- unsigned int reserved : 7;
- unsigned int htabmask : 9;
- } bits;
-} sdr1_t;
-
-/* Block mapping registers. These values are model dependent.
- * Eventually, we will need to up these to 64 bit values.
- */
-
-#define blokValid 0x1FFE0000
-#define batMin 0x00020000
-#define batMax 0x10000000
-#define batICnt 4
-#define batDCnt 4
-
-/* BAT register structures.
- * Not used for standard mappings, but may be used
- * for mapping devices. Note that the 601 has a
- * different BAT layout than the other PowerPC processors
- */
-
-typedef union {
- unsigned int word;
- struct {
- unsigned int blpi : 15;
- unsigned int reserved : 10;
- unsigned int wim : 3;
- unsigned int ks : 1;
- unsigned int ku : 1;
- unsigned int pp : 2;
- } bits;
-} bat601u_t;
-
-typedef union {
- unsigned int word;
- struct {
- unsigned int pbn : 15;
- unsigned int reserved : 10;
- unsigned int valid : 1;
- unsigned int bsm : 6;
- } bits;
-} bat601l_t;
-
-typedef struct bat601_t {
- bat601u_t upper;
- bat601l_t lower;
-} bat601_t;
-
-typedef union {
- unsigned int word;
- struct {
- unsigned int bepi : 15;
- unsigned int reserved : 4;
- unsigned int bl : 11;
- unsigned int vs : 1;
- unsigned int vp : 1;
- } bits;
-} batu_t;
-
-typedef union {
- unsigned int word;
- struct {
- unsigned int brpn : 15;
- unsigned int reserved : 10;
- unsigned int wimg : 4;
- unsigned int reserved2 : 1;
- unsigned int pp : 2;
- } bits;
-} batl_t;
-
-typedef struct bat_t {
- batu_t upper;
- batl_t lower;
-} bat_t;
-
-/* PTE entries
- * Used extensively for standard mappings
- */
-
-typedef union {
- unsigned int word;
- struct {
- unsigned int valid : 1;
- unsigned int segment_id : 24;
- unsigned int hash_id : 1;
- unsigned int page_index : 6; /* Abbreviated */
- } bits;
- struct {
- unsigned int valid : 1;
- unsigned int not_used : 5;
- unsigned int segment_id : 19; /* Least Sig 19 bits */
- unsigned int hash_id : 1;
- unsigned int page_index : 6;
- } hash_bits;
-} pte0_t;
-
-typedef union {
- unsigned int word;
- struct {
- unsigned int phys_page : 20;
- unsigned int reserved3 : 3;
- unsigned int referenced : 1;
- unsigned int changed : 1;
- unsigned int wimg : 4;
- unsigned int reserved1 : 1;
- unsigned int protection : 2;
- } bits;
-} pte1_t;
-
-typedef struct pte_t {
- pte0_t pte0;
- pte1_t pte1;
-} pte_t;
-
-/*
- * A virtual address is decoded into various parts when looking for its PTE
- */
-
-typedef struct va_full_t {
- unsigned int seg_num : 4;
- unsigned int page_index : 16;
- unsigned int byte_ofs : 12;
-} va_full_t;
-
-typedef struct va_abbrev_t { /* use bits.abbrev for abbreviated page index */
- unsigned int seg_num : 4;
- unsigned int page_index : 6;
- unsigned int junk : 10;
- unsigned int byte_ofs : 12;
-} va_abbrev_t;
-
-typedef union {
- unsigned int word;
- va_full_t full;
- va_abbrev_t abbrev;
-} virtual_addr_t;
-
-/* A physical address can be split up into page and offset */
-
-typedef struct pa_t {
- unsigned int page_no : 20;
- unsigned int offset : 12;
-} pa_t;
-
-typedef union {
- unsigned int word;
- pa_t bits;
-} physical_addr_t;