Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / openbios / arch / ppc / mmutypes.h
1 /*
2  *   Creation Date: <2002/01/13 13:53:14 samuel>
3  *   Time-stamp: <2002/01/27 19:56:11 samuel>
4  *
5  *      <mmutypes.h>
6  *
7  *      MMU definitions
8  *
9  *   Most of these declarations originate from the Linux Kernel
10  *
11  *   Copyright (C) 2002 Samuel Rydh (samuel@ibrium.se)
12  *
13  *   This program is free software; you can redistribute it and/or
14  *   modify it under the terms of the GNU General Public License
15  *   as published by the Free Software Foundation
16  *
17  */
18
19 #ifndef _H_MMUTYPES
20 #define _H_MMUTYPES
21
22 /* Hardware Page Table Entry */
23 typedef struct mPTE {
24         unsigned long v:1;      /* Entry is valid */
25         unsigned long vsid:24;  /* Virtual segment identifier */
26         unsigned long h:1;      /* Hash algorithm indicator */
27         unsigned long api:6;    /* Abbreviated page index */
28
29         unsigned long rpn:20;   /* Real (physical) page number */
30         unsigned long    :3;    /* Unused */
31         unsigned long r:1;      /* Referenced */
32         unsigned long c:1;      /* Changed */
33         unsigned long w:1;      /* Write-thru cache mode */
34         unsigned long i:1;      /* Cache inhibited */
35         unsigned long m:1;      /* Memory coherence */
36         unsigned long g:1;      /* Guarded */
37         unsigned long  :1;      /* Unused */
38         unsigned long pp:2;     /* Page protection */
39 } mPTE_t;
40
41
42 typedef struct _mBATU {         /* Upper part of BAT (all except 601) */
43         unsigned long bepi:15;  /* Effective page index (virtual address) */
44         unsigned long :4;       /* Unused */
45         unsigned long bl:11;    /* Block size mask */
46         unsigned long vs:1;     /* Supervisor valid */
47         unsigned long vp:1;     /* User valid */
48 } mBATU;
49
50 typedef struct _mBATL {         /* Lower part of BAT (all except 601) */
51         unsigned long brpn:15;  /* Real page index (physical address) */
52         unsigned long :10;      /* Unused */
53         unsigned long w:1;      /* Write-thru cache */
54         unsigned long i:1;      /* Cache inhibit */
55         unsigned long m:1;      /* Memory coherence */
56         unsigned long g:1;      /* Guarded (MBZ in IBAT) */
57         unsigned long :1;       /* Unused */
58         unsigned long pp:2;     /* Page access protections */
59 } mBATL;
60
61 typedef struct _mBAT {
62         mBATU batu;             /* Upper register */
63         mBATL batl;             /* Lower register */
64 } mBAT;
65
66 typedef struct _mSEGREG {
67         unsigned long t:1;      /* Normal or I/O  type */
68         unsigned long ks:1;     /* Supervisor 'key' (normally 0) */
69         unsigned long kp:1;     /* User 'key' (normally 1) */
70         unsigned long n:1;      /* No-execute */
71         unsigned long :4;       /* Unused */
72         unsigned long vsid:24;  /* Virtual Segment Identifier */
73 } mSEGREG;
74
75
76 #endif   /* _H_MMUTYPES */