ia64/xen-unstable

changeset 15125:0dc47397aad8

[IA64] memmap: add necessary definitions

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Alex Williamson <alex.williamson@hp.com>
date Mon May 21 13:59:38 2007 -0600 (2007-05-21)
parents 1d74c51c2d5a
children 9d5dc8f3b2d4
files tools/libxc/ia64/aclinux.h tools/libxc/ia64/sal.h tools/libxc/xc_efi.h
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tools/libxc/ia64/aclinux.h	Mon May 21 13:59:38 2007 -0600
     1.3 @@ -0,0 +1,111 @@
     1.4 +/******************************************************************************
     1.5 + *
     1.6 + * Name: aclinux.h - OS specific defines, etc.
     1.7 + *
     1.8 + *****************************************************************************/
     1.9 +
    1.10 +/*
    1.11 + * Copyright (C) 2000 - 2005, R. Byron Moore
    1.12 + * All rights reserved.
    1.13 + *
    1.14 + * Redistribution and use in source and binary forms, with or without
    1.15 + * modification, are permitted provided that the following conditions
    1.16 + * are met:
    1.17 + * 1. Redistributions of source code must retain the above copyright
    1.18 + *    notice, this list of conditions, and the following disclaimer,
    1.19 + *    without modification.
    1.20 + * 2. Redistributions in binary form must reproduce at minimum a disclaimer
    1.21 + *    substantially similar to the "NO WARRANTY" disclaimer below
    1.22 + *    ("Disclaimer") and any redistribution must be conditioned upon
    1.23 + *    including a substantially similar Disclaimer requirement for further
    1.24 + *    binary redistribution.
    1.25 + * 3. Neither the names of the above-listed copyright holders nor the names
    1.26 + *    of any contributors may be used to endorse or promote products derived
    1.27 + *    from this software without specific prior written permission.
    1.28 + *
    1.29 + * Alternatively, this software may be distributed under the terms of the
    1.30 + * GNU General Public License ("GPL") version 2 as published by the Free
    1.31 + * Software Foundation.
    1.32 + *
    1.33 + * NO WARRANTY
    1.34 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    1.35 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    1.36 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
    1.37 + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    1.38 + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    1.39 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    1.40 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    1.41 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
    1.42 + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
    1.43 + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    1.44 + * POSSIBILITY OF SUCH DAMAGES.
    1.45 + */
    1.46 +
    1.47 +#ifndef __ACLINUX_H__
    1.48 +#define __ACLINUX_H__
    1.49 +
    1.50 +#define ACPI_USE_SYSTEM_CLIBRARY
    1.51 +#define ACPI_USE_DO_WHILE_0
    1.52 +
    1.53 +#if 0 /* def __KERNEL__ */
    1.54 +
    1.55 +#include <xen/config.h>
    1.56 +#include <xen/string.h>
    1.57 +#include <xen/kernel.h>
    1.58 +#include <xen/ctype.h>
    1.59 +#include <asm/system.h>
    1.60 +#include <asm/atomic.h>
    1.61 +#include <asm/div64.h>
    1.62 +#include <asm/acpi.h>
    1.63 +
    1.64 +#define strtoul simple_strtoul
    1.65 +
    1.66 +#define ACPI_MACHINE_WIDTH  BITS_PER_LONG
    1.67 +
    1.68 +#else /* !__KERNEL__ */
    1.69 +
    1.70 +#include <stdarg.h>
    1.71 +#include <string.h>
    1.72 +//#include <stdlib.h>
    1.73 +#include <ctype.h>
    1.74 +#include <unistd.h>
    1.75 +
    1.76 +#if defined(__ia64__) || defined(__x86_64__)
    1.77 +#define ACPI_MACHINE_WIDTH          64
    1.78 +#define COMPILER_DEPENDENT_INT64    long
    1.79 +#define COMPILER_DEPENDENT_UINT64   unsigned long
    1.80 +#else
    1.81 +#define ACPI_MACHINE_WIDTH          32
    1.82 +#define COMPILER_DEPENDENT_INT64    long long
    1.83 +#define COMPILER_DEPENDENT_UINT64   unsigned long long
    1.84 +#define ACPI_USE_NATIVE_DIVIDE
    1.85 +#endif
    1.86 +
    1.87 +typedef int8_t		s8;
    1.88 +typedef uint8_t		u8;
    1.89 +typedef int16_t		s16;
    1.90 +typedef uint16_t	u16;
    1.91 +typedef int32_t		s32;
    1.92 +typedef uint32_t	u32;
    1.93 +typedef int64_t		s64;
    1.94 +typedef uint64_t	u64;
    1.95 +#define __iomem
    1.96 +#ifdef __ia64__
    1.97 +#ifdef __cplusplus
    1.98 +#define CPP_ASMLINKAGE extern "C"
    1.99 +#else
   1.100 +#define CPP_ASMLINKAGE
   1.101 +#endif
   1.102 +#define asmlinkage CPP_ASMLINKAGE __attribute__((syscall_linkage))
   1.103 +#endif
   1.104 +#define CONFIG_ACPI_BOOT	1
   1.105 +
   1.106 +#define __cdecl
   1.107 +#define ACPI_FLUSH_CPU_CACHE()
   1.108 +#endif /* __KERNEL__ */
   1.109 +
   1.110 +/* Linux uses GCC */
   1.111 +
   1.112 +#include "acgcc.h"
   1.113 +
   1.114 +#endif /* __ACLINUX_H__ */
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/tools/libxc/ia64/sal.h	Mon May 21 13:59:38 2007 -0600
     2.3 @@ -0,0 +1,71 @@
     2.4 +#ifndef XC_IA64_SAL_H
     2.5 +#define XC_IA64_SAL_H
     2.6 +
     2.7 +/*
     2.8 + * definitions from
     2.9 + * xen/include/asm-ia64/linux/asm/sal.h
    2.10 + */
    2.11 +
    2.12 +/*
    2.13 + * The SAL system table is followed by a variable number of variable
    2.14 + * length descriptors.  The structure of these descriptors follows
    2.15 + * below.
    2.16 + * The defininition follows SAL specs from July 2000
    2.17 + */
    2.18 +struct ia64_sal_systab {
    2.19 +	uint8_t signature[4];	/* should be "SST_" */
    2.20 +	uint32_t size;		/* size of this table in bytes */
    2.21 +	uint8_t sal_rev_minor;
    2.22 +	uint8_t sal_rev_major;
    2.23 +	uint16_t entry_count;	/* # of entries in variable portion */
    2.24 +	uint8_t checksum;
    2.25 +	uint8_t reserved1[7];
    2.26 +	uint8_t sal_a_rev_minor;
    2.27 +	uint8_t sal_a_rev_major;
    2.28 +	uint8_t sal_b_rev_minor;
    2.29 +	uint8_t sal_b_rev_major;
    2.30 +	/* oem_id & product_id: terminating NUL is missing if string is exactly 32 bytes long. */
    2.31 +	uint8_t oem_id[32];
    2.32 +	uint8_t product_id[32];	/* ASCII product id  */
    2.33 +	uint8_t reserved2[8];
    2.34 +};
    2.35 +
    2.36 +enum sal_systab_entry_type {
    2.37 +	SAL_DESC_ENTRY_POINT = 0,
    2.38 +	SAL_DESC_MEMORY = 1,
    2.39 +	SAL_DESC_PLATFORM_FEATURE = 2,
    2.40 +	SAL_DESC_TR = 3,
    2.41 +	SAL_DESC_PTC = 4,
    2.42 +	SAL_DESC_AP_WAKEUP = 5
    2.43 +};
    2.44 +
    2.45 +typedef struct ia64_sal_desc_entry_point {
    2.46 +	uint8_t type;
    2.47 +	uint8_t reserved1[7];
    2.48 +	uint64_t pal_proc;
    2.49 +	uint64_t sal_proc;
    2.50 +	uint64_t gp;
    2.51 +	uint8_t reserved2[16];
    2.52 +}ia64_sal_desc_entry_point_t;
    2.53 +
    2.54 +#define IA64_SAL_AP_EXTERNAL_INT 0
    2.55 +
    2.56 +typedef struct ia64_sal_desc_ap_wakeup {
    2.57 +	uint8_t type;
    2.58 +	uint8_t mechanism;		/* 0 == external interrupt */
    2.59 +	uint8_t reserved1[6];
    2.60 +	uint64_t vector;		/* interrupt vector in range 0x10-0xff */
    2.61 +} ia64_sal_desc_ap_wakeup_t ;
    2.62 +
    2.63 +//XXX should move xen_sal_data to arch-ia64.h?
    2.64 +/* These are data in domain memory for SAL emulator.  */
    2.65 +struct xen_sal_data {
    2.66 +    /* OS boot rendez vous.  */
    2.67 +    unsigned long boot_rdv_ip;
    2.68 +    unsigned long boot_rdv_r1;
    2.69 +
    2.70 +    /* There are these for EFI_SET_VIRTUAL_ADDRESS_MAP emulation. */
    2.71 +    int efi_virt_mode;          /* phys : 0 , virt : 1 */
    2.72 +};
    2.73 +
    2.74 +#endif /* XC_IA64_SAL_H */
     3.1 --- a/tools/libxc/xc_efi.h	Mon May 21 13:55:58 2007 -0600
     3.2 +++ b/tools/libxc/xc_efi.h	Mon May 21 13:59:38 2007 -0600
     3.3 @@ -14,6 +14,28 @@
     3.4   *      Stephane Eranian <eranian@hpl.hp.com>
     3.5   */
     3.6  
     3.7 +typedef struct {
     3.8 +        uint8_t b[16];
     3.9 +} efi_guid_t;
    3.10 +
    3.11 +#define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \
    3.12 +((efi_guid_t) \
    3.13 +{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
    3.14 +  (b) & 0xff, ((b) >> 8) & 0xff, \
    3.15 +  (c) & 0xff, ((c) >> 8) & 0xff, \
    3.16 +  (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
    3.17 +
    3.18 +/*
    3.19 + * Generic EFI table header
    3.20 + */
    3.21 +typedef	struct {
    3.22 +	uint64_t signature;
    3.23 +	uint32_t revision;
    3.24 +	uint32_t headersize;
    3.25 +	uint32_t crc32;
    3.26 +	uint32_t reserved;
    3.27 +} efi_table_hdr_t;
    3.28 +
    3.29  /*
    3.30   * Memory map descriptor:
    3.31   */
    3.32 @@ -65,4 +87,59 @@ typedef struct {
    3.33  #endif
    3.34  } efi_memory_desc_t;
    3.35  
    3.36 +/*
    3.37 + * EFI Runtime Services table
    3.38 + */
    3.39 +#define EFI_RUNTIME_SERVICES_SIGNATURE	((uint64_t)0x5652453544e5552ULL)
    3.40 +#define EFI_RUNTIME_SERVICES_REVISION	0x00010000
    3.41 +
    3.42 +typedef struct {
    3.43 +	efi_table_hdr_t hdr;
    3.44 +	unsigned long get_time;
    3.45 +	unsigned long set_time;
    3.46 +	unsigned long get_wakeup_time;
    3.47 +	unsigned long set_wakeup_time;
    3.48 +	unsigned long set_virtual_address_map;
    3.49 +	unsigned long convert_pointer;
    3.50 +	unsigned long get_variable;
    3.51 +	unsigned long get_next_variable;
    3.52 +	unsigned long set_variable;
    3.53 +	unsigned long get_next_high_mono_count;
    3.54 +	unsigned long reset_system;
    3.55 +} efi_runtime_services_t;
    3.56 +
    3.57 +/*
    3.58 + *  EFI Configuration Table and GUID definitions
    3.59 + */
    3.60 +#define NULL_GUID \
    3.61 +    EFI_GUID(  0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 )
    3.62 +#define ACPI_20_TABLE_GUID    \
    3.63 +    EFI_GUID(  0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 )
    3.64 +#define SAL_SYSTEM_TABLE_GUID    \
    3.65 +    EFI_GUID(  0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d )
    3.66 +
    3.67 +typedef struct {
    3.68 +	efi_guid_t guid;
    3.69 +	unsigned long table;
    3.70 +} efi_config_table_t;
    3.71 +
    3.72 +#define EFI_SYSTEM_TABLE_SIGNATURE ((uint64_t)0x5453595320494249ULL)
    3.73 +#define EFI_SYSTEM_TABLE_REVISION  ((1 << 16) | 00)
    3.74 +
    3.75 +typedef struct {
    3.76 +	efi_table_hdr_t hdr;
    3.77 +	unsigned long fw_vendor;	/* physical addr of CHAR16 vendor string */
    3.78 +	uint32_t fw_revision;
    3.79 +	unsigned long con_in_handle;
    3.80 +	unsigned long con_in;
    3.81 +	unsigned long con_out_handle;
    3.82 +	unsigned long con_out;
    3.83 +	unsigned long stderr_handle;
    3.84 +	unsigned long stderr;
    3.85 +	efi_runtime_services_t *runtime;
    3.86 +	unsigned long boottime;
    3.87 +	unsigned long nr_tables;
    3.88 +	unsigned long tables;
    3.89 +} efi_system_table_t;
    3.90 +
    3.91  #endif /* XC_EFI_H */