Changeset b3f8fb7 in mainline for kernel/arch/ia32xen/include


Ignore:
Timestamp:
2007-01-28T13:25:49Z (18 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8e8c1a5
Parents:
1ba41c5
Message:

huge type system cleanup
remove cyclical type dependencies across multiple header files
many minor coding style fixes

Location:
kernel/arch/ia32xen/include
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32xen/include/hypercall.h

    r1ba41c5 rb3f8fb7  
    3030#define KERN_ia32xen_HYPERCALL_H_
    3131
    32 #include <arch/types.h>
    33 #include <macros.h>
    34 
    35 typedef uint16_t domid_t;
    36 
    37 typedef struct {
    38         uint8_t vector;     /**< Exception vector */
    39         uint8_t flags;      /**< 0-3: privilege level; 4: clear event enable */
    40         uint16_t cs;        /**< Code selector */
    41         void *address;      /**< Code offset */
    42 } trap_info_t;
    43 
    44 
    45 typedef struct {
    46         evtchn_t port;
    47 } evtchn_send_t;
    48 
    49 typedef struct {
    50         uint32_t cmd;
    51         union {
    52                 evtchn_send_t send;
    53     };
    54 } evtchn_op_t;
    55 
     32#ifndef __ASM__
     33#       include <arch/types.h>
     34#       include <macros.h>
     35#endif
     36
     37#define GUEST_CMDLINE   1024
     38#define VIRT_CPUS       32
     39#define START_INFO_SIZE 1104
     40
     41#define BOOT_OFFSET             0x0000
     42#define TEMP_STACK_SIZE 0x1000
     43
     44#define XEN_VIRT_START  0xFC000000
     45#define XEN_CS                  0xe019
     46
     47#define XEN_ELFNOTE_INFO                        0
     48#define XEN_ELFNOTE_ENTRY                       1
     49#define XEN_ELFNOTE_HYPERCALL_PAGE      2
     50#define XEN_ELFNOTE_VIRT_BASE           3
     51#define XEN_ELFNOTE_PADDR_OFFSET        4
     52#define XEN_ELFNOTE_XEN_VERSION         5
     53#define XEN_ELFNOTE_GUEST_OS            6
     54#define XEN_ELFNOTE_GUEST_VERSION       7
     55#define XEN_ELFNOTE_LOADER                      8
     56#define XEN_ELFNOTE_PAE_MODE            9
     57#define XEN_ELFNOTE_FEATURES            10
     58#define XEN_ELFNOTE_BSD_SYMTAB          11
     59
     60#define mp_map ((pfn_t *) XEN_VIRT_START)
     61
     62#define SIF_PRIVILEGED  (1 << 0)  /**< Privileged domain */
     63#define SIF_INITDOMAIN  (1 << 1)  /**< Iinitial control domain */
     64
     65#define XEN_CONSOLE_VGA         0x03
     66#define XEN_CONSOLE_VESA        0x23
    5667
    5768#define XEN_SET_TRAP_TABLE              0
     
    104115#define DOMID_IO   (0x7FF1U)
    105116
     117#ifndef __ASM__
     118
     119typedef uint16_t domid_t;
     120typedef uint32_t evtchn_t;
     121
     122typedef struct {
     123        uint32_t version;
     124        uint32_t pad0;
     125        uint64_t tsc_timestamp;   /**< TSC at last update of time vals */
     126        uint64_t system_time;     /**< Time, in nanosecs, since boot */
     127        uint32_t tsc_to_system_mul;
     128        int8_t tsc_shift;
     129        int8_t pad1[3];
     130} vcpu_time_info_t;
     131
     132typedef struct {
     133        uint32_t cr2;
     134        uint32_t pad[5];
     135} arch_vcpu_info_t;
     136
     137typedef struct arch_shared_info {
     138        pfn_t max_pfn;                  /**< max pfn that appears in table */
     139        uint32_t pfn_to_mfn_frame_list_list;
     140    uint32_t nmi_reason;
     141} arch_shared_info_t;
     142
     143typedef struct {
     144        uint8_t evtchn_upcall_pending;
     145        ipl_t evtchn_upcall_mask;
     146        evtchn_t evtchn_pending_sel;
     147        arch_vcpu_info_t arch;
     148        vcpu_time_info_t time;
     149} vcpu_info_t;
     150
     151typedef struct {
     152        vcpu_info_t vcpu_info[VIRT_CPUS];
     153        evtchn_t evtchn_pending[32];
     154        evtchn_t evtchn_mask[32];
     155       
     156        uint32_t wc_version;                  /**< Version counter */
     157        uint32_t wc_sec;                      /**< Secs  00:00:00 UTC, Jan 1, 1970 */
     158        uint32_t wc_nsec;                     /**< Nsecs 00:00:00 UTC, Jan 1, 1970 */
     159       
     160        arch_shared_info_t arch;
     161} shared_info_t;
     162
     163typedef struct {
     164        int8_t magic[32];           /**< "xen-<version>-<platform>" */
     165        uint32_t frames;            /**< Available frames */
     166        shared_info_t *shared_info; /**< Shared info structure (machine address) */
     167        uint32_t flags;             /**< SIF_xxx flags */
     168        pfn_t store_mfn;            /**< Shared page (machine page) */
     169        evtchn_t store_evtchn;      /**< Event channel for store communication */
     170       
     171        union {
     172        struct {
     173                        pfn_t mfn;          /**< Console page (machine page) */
     174                        evtchn_t evtchn;    /**< Event channel for console messages */
     175        } domU;
     176               
     177        struct {
     178            uint32_t info_off;  /**< Offset of console_info struct */
     179            uint32_t info_size; /**< Size of console_info struct from start */
     180        } dom0;
     181    } console;
     182       
     183        pte_t *ptl0;                /**< Boot PTL0 (kernel address) */
     184        uint32_t pt_frames;         /**< Number of bootstrap page table frames */
     185        pfn_t *pm_map;              /**< Physical->machine frame map (kernel address) */
     186        void *mod_start;            /**< Modules start (kernel address) */
     187        uint32_t mod_len;           /**< Modules size (bytes) */
     188        int8_t cmd_line[GUEST_CMDLINE];
     189} start_info_t;
     190
     191typedef struct {
     192    uint8_t video_type; 
     193
     194    union {
     195        struct {
     196            uint16_t font_height;
     197            uint16_t cursor_x;
     198                        uint16_t cursor_y;
     199            uint16_t rows;
     200                        uint16_t columns;
     201        } vga;
     202
     203        struct {
     204            uint16_t width;
     205                        uint16_t height;
     206            uint16_t bytes_per_line;
     207            uint16_t bits_per_pixel;
     208            uint32_t lfb_base;
     209            uint32_t lfb_size;
     210            uint8_t red_pos;
     211                        uint8_t red_size;
     212            uint8_t green_pos;
     213                        uint8_t green_size;
     214            uint8_t blue_pos;
     215                        uint8_t blue_size;
     216            uint8_t rsvd_pos;
     217                        uint8_t rsvd_size;
     218        } vesa_lfb;
     219    } info;
     220} console_info_t;
     221
     222typedef struct {
     223        pfn_t start;
     224        pfn_t size;
     225        pfn_t reserved;
     226} memzone_t;
     227
     228extern start_info_t start_info;
     229extern shared_info_t shared_info;
     230extern memzone_t meminfo;
     231
     232typedef struct {
     233        uint8_t vector;     /**< Exception vector */
     234        uint8_t flags;      /**< 0-3: privilege level; 4: clear event enable */
     235        uint16_t cs;        /**< Code selector */
     236        void *address;      /**< Code offset */
     237} trap_info_t;
     238
     239typedef struct {
     240        evtchn_t port;
     241} evtchn_send_t;
     242
     243typedef struct {
     244        uint32_t cmd;
     245        union {
     246                evtchn_send_t send;
     247    };
     248} evtchn_op_t;
    106249
    107250#define force_evtchn_callback() ((void) xen_version(0, 0))
     
    235378
    236379#endif
     380
     381#endif
  • kernel/arch/ia32xen/include/mm/as.h

    r1ba41c5 rb3f8fb7  
    4848} as_arch_t;
    4949
     50#include <genarch/mm/as_pt.h>
     51
    5052#define as_constructor_arch(as, flags)          (as != as)
    5153#define as_destructor_arch(as)                  (as != as)
  • kernel/arch/ia32xen/include/mm/frame.h

    r1ba41c5 rb3f8fb7  
    4343#ifndef __ASM__
    4444
    45 #include <arch/types.h>
    46 #include <arch/boot/boot.h>
    47 
    4845#define PA2MA(x)        ((start_info.pm_map[((uintptr_t) (x)) >> 12] << 12) + (((uintptr_t) (x)) & 0xfff))
    4946#define MA2PA(x)        ((mp_map[((uintptr_t) (x)) >> 12] << 12) + (((uintptr_t) (x)) & 0xfff))
  • kernel/arch/ia32xen/include/mm/memory_init.h

    r1ba41c5 rb3f8fb7  
    3737#define KERN_ia32xen_MEMORY_INIT_H_
    3838
    39 #include <typedefs.h>
     39#include <arch/types.h>
    4040
    4141size_t get_memory_size(void);
  • kernel/arch/ia32xen/include/mm/page.h

    r1ba41c5 rb3f8fb7  
    122122#ifndef __ASM__
    123123
    124 #include <mm/page.h>
    125 #include <arch/types.h>
    126 #include <arch/mm/frame.h>
    127 #include <typedefs.h>
     124#include <mm/mm.h>
    128125#include <arch/hypercall.h>
     126#include <arch/interrupt.h>
    129127
    130128/* Page fault error codes. */
     
    141139/** When bit on this position is 1, a reserved bit was set in page directory. */
    142140#define PFERR_CODE_RSVD         (1 << 3)
    143 
    144 /** Page Table Entry. */
    145 struct page_specifier {
    146         unsigned present : 1;
    147         unsigned writeable : 1;
    148         unsigned uaccessible : 1;
    149         unsigned page_write_through : 1;
    150         unsigned page_cache_disable : 1;
    151         unsigned accessed : 1;
    152         unsigned dirty : 1;
    153         unsigned pat : 1;
    154         unsigned global : 1;
    155         unsigned soft_valid : 1;        /**< Valid content even if the present bit is not set. */
    156         unsigned avl : 2;
    157         unsigned frame_address : 20;
    158 } __attribute__ ((packed));
    159141
    160142typedef struct {
  • kernel/arch/ia32xen/include/pm.h

    r1ba41c5 rb3f8fb7  
    7070
    7171#include <arch/types.h>
    72 #include <typedefs.h>
    7372#include <arch/context.h>
    7473
  • kernel/arch/ia32xen/include/types.h

    r1ba41c5 rb3f8fb7  
    3737
    3838#define NULL 0
     39#define false 0
     40#define true 1
    3941
    4042typedef signed char int8_t;
     
    4850typedef unsigned long long uint64_t;
    4951
     52typedef uint32_t size_t;
     53typedef uint32_t count_t;
     54typedef uint32_t index_t;
     55
    5056typedef uint32_t uintptr_t;
    5157typedef uint32_t pfn_t;
     
    5662typedef int32_t native_t;
    5763
    58 typedef struct page_specifier pte_t;
     64typedef uint8_t bool;
     65typedef uint64_t task_id_t;
     66typedef uint32_t context_id_t;
     67
     68typedef int32_t inr_t;
     69typedef int32_t devno_t;
     70
     71/** Page Table Entry. */
     72typedef struct {
     73        unsigned present : 1;
     74        unsigned writeable : 1;
     75        unsigned uaccessible : 1;
     76        unsigned page_write_through : 1;
     77        unsigned page_cache_disable : 1;
     78        unsigned accessed : 1;
     79        unsigned dirty : 1;
     80        unsigned pat : 1;
     81        unsigned global : 1;
     82        unsigned soft_valid : 1;        /**< Valid content even if the present bit is not set. */
     83        unsigned avl : 2;
     84        unsigned frame_address : 20;
     85} __attribute__ ((packed)) pte_t;
    5986
    6087#endif
Note: See TracChangeset for help on using the changeset viewer.