The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/xen/interface/platform.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /******************************************************************************
    2  * platform.h
    3  * 
    4  * Hardware platform operations. Intended for use by domain-0 kernel.
    5  * 
    6  * Permission is hereby granted, free of charge, to any person obtaining a copy
    7  * of this software and associated documentation files (the "Software"), to
    8  * deal in the Software without restriction, including without limitation the
    9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
   10  * sell copies of the Software, and to permit persons to whom the Software is
   11  * furnished to do so, subject to the following conditions:
   12  *
   13  * The above copyright notice and this permission notice shall be included in
   14  * all copies or substantial portions of the Software.
   15  *
   16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
   21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
   22  * DEALINGS IN THE SOFTWARE.
   23  *
   24  * Copyright (c) 2002-2006, K Fraser
   25  */
   26 
   27 #ifndef __XEN_PUBLIC_PLATFORM_H__
   28 #define __XEN_PUBLIC_PLATFORM_H__
   29 
   30 #include "xen.h"
   31 
   32 #define XENPF_INTERFACE_VERSION 0x03000001
   33 
   34 /*
   35  * Set clock such that it would read <secs,nsecs> after 00:00:00 UTC,
   36  * 1 January, 1970 if the current system time was <system_time>.
   37  */
   38 #define XENPF_settime32           17
   39 struct xenpf_settime32 {
   40     /* IN variables. */
   41     uint32_t secs;
   42     uint32_t nsecs;
   43     uint64_t system_time;
   44 };
   45 #define XENPF_settime64           62
   46 struct xenpf_settime64 {
   47     /* IN variables. */
   48     uint64_t secs;
   49     uint32_t nsecs;
   50     uint32_t mbz;
   51     uint64_t system_time;
   52 };
   53 #if __XEN_INTERFACE_VERSION__ < 0x00040600
   54 #define XENPF_settime XENPF_settime32
   55 #define xenpf_settime xenpf_settime32
   56 #else
   57 #define XENPF_settime XENPF_settime64
   58 #define xenpf_settime xenpf_settime64
   59 #endif
   60 typedef struct xenpf_settime xenpf_settime_t;
   61 DEFINE_XEN_GUEST_HANDLE(xenpf_settime_t);
   62 
   63 /*
   64  * Request memory range (@mfn, @mfn+@nr_mfns-1) to have type @type.
   65  * On x86, @type is an architecture-defined MTRR memory type.
   66  * On success, returns the MTRR that was used (@reg) and a handle that can
   67  * be passed to XENPF_DEL_MEMTYPE to accurately tear down the new setting.
   68  * (x86-specific).
   69  */
   70 #define XENPF_add_memtype         31
   71 struct xenpf_add_memtype {
   72     /* IN variables. */
   73     xen_pfn_t mfn;
   74     uint64_t nr_mfns;
   75     uint32_t type;
   76     /* OUT variables. */
   77     uint32_t handle;
   78     uint32_t reg;
   79 };
   80 typedef struct xenpf_add_memtype xenpf_add_memtype_t;
   81 DEFINE_XEN_GUEST_HANDLE(xenpf_add_memtype_t);
   82 
   83 /*
   84  * Tear down an existing memory-range type. If @handle is remembered then it
   85  * should be passed in to accurately tear down the correct setting (in case
   86  * of overlapping memory regions with differing types). If it is not known
   87  * then @handle should be set to zero. In all cases @reg must be set.
   88  * (x86-specific).
   89  */
   90 #define XENPF_del_memtype         32
   91 struct xenpf_del_memtype {
   92     /* IN variables. */
   93     uint32_t handle;
   94     uint32_t reg;
   95 };
   96 typedef struct xenpf_del_memtype xenpf_del_memtype_t;
   97 DEFINE_XEN_GUEST_HANDLE(xenpf_del_memtype_t);
   98 
   99 /* Read current type of an MTRR (x86-specific). */
  100 #define XENPF_read_memtype        33
  101 struct xenpf_read_memtype {
  102     /* IN variables. */
  103     uint32_t reg;
  104     /* OUT variables. */
  105     xen_pfn_t mfn;
  106     uint64_t nr_mfns;
  107     uint32_t type;
  108 };
  109 typedef struct xenpf_read_memtype xenpf_read_memtype_t;
  110 DEFINE_XEN_GUEST_HANDLE(xenpf_read_memtype_t);
  111 
  112 #define XENPF_microcode_update    35
  113 struct xenpf_microcode_update {
  114     /* IN variables. */
  115     XEN_GUEST_HANDLE(const_void) data;/* Pointer to microcode data */
  116     uint32_t length;                  /* Length of microcode data. */
  117 };
  118 typedef struct xenpf_microcode_update xenpf_microcode_update_t;
  119 DEFINE_XEN_GUEST_HANDLE(xenpf_microcode_update_t);
  120 
  121 #define XENPF_platform_quirk      39
  122 #define QUIRK_NOIRQBALANCING      1 /* Do not restrict IO-APIC RTE targets */
  123 #define QUIRK_IOAPIC_BAD_REGSEL   2 /* IO-APIC REGSEL forgets its value    */
  124 #define QUIRK_IOAPIC_GOOD_REGSEL  3 /* IO-APIC REGSEL behaves properly     */
  125 struct xenpf_platform_quirk {
  126     /* IN variables. */
  127     uint32_t quirk_id;
  128 };
  129 typedef struct xenpf_platform_quirk xenpf_platform_quirk_t;
  130 DEFINE_XEN_GUEST_HANDLE(xenpf_platform_quirk_t);
  131 
  132 #define XENPF_efi_runtime_call    49
  133 #define XEN_EFI_get_time                      1
  134 #define XEN_EFI_set_time                      2
  135 #define XEN_EFI_get_wakeup_time               3
  136 #define XEN_EFI_set_wakeup_time               4
  137 #define XEN_EFI_get_next_high_monotonic_count 5
  138 #define XEN_EFI_get_variable                  6
  139 #define XEN_EFI_set_variable                  7
  140 #define XEN_EFI_get_next_variable_name        8
  141 #define XEN_EFI_query_variable_info           9
  142 #define XEN_EFI_query_capsule_capabilities   10
  143 #define XEN_EFI_update_capsule               11
  144 
  145 struct xenpf_efi_time {
  146     uint16_t year;
  147     uint8_t month;
  148     uint8_t day;
  149     uint8_t hour;
  150     uint8_t min;
  151     uint8_t sec;
  152     uint32_t ns;
  153     int16_t tz;
  154     uint8_t daylight;
  155 };
  156 
  157 struct xenpf_efi_guid {
  158     uint32_t data1;
  159     uint16_t data2;
  160     uint16_t data3;
  161     uint8_t data4[8];
  162 };
  163 
  164 struct xenpf_efi_runtime_call {
  165     uint32_t function;
  166     /*
  167      * This field is generally used for per sub-function flags (defined
  168      * below), except for the XEN_EFI_get_next_high_monotonic_count case,
  169      * where it holds the single returned value.
  170      */
  171     uint32_t misc;
  172     xen_ulong_t status;
  173     union {
  174 #define XEN_EFI_GET_TIME_SET_CLEARS_NS 0x00000001
  175         struct {
  176             struct xenpf_efi_time time;
  177             uint32_t resolution;
  178             uint32_t accuracy;
  179         } get_time;
  180 
  181         struct xenpf_efi_time set_time;
  182 
  183 #define XEN_EFI_GET_WAKEUP_TIME_ENABLED 0x00000001
  184 #define XEN_EFI_GET_WAKEUP_TIME_PENDING 0x00000002
  185         struct xenpf_efi_time get_wakeup_time;
  186 
  187 #define XEN_EFI_SET_WAKEUP_TIME_ENABLE      0x00000001
  188 #define XEN_EFI_SET_WAKEUP_TIME_ENABLE_ONLY 0x00000002
  189         struct xenpf_efi_time set_wakeup_time;
  190 
  191 #define XEN_EFI_VARIABLE_NON_VOLATILE       0x00000001
  192 #define XEN_EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
  193 #define XEN_EFI_VARIABLE_RUNTIME_ACCESS     0x00000004
  194         struct {
  195             XEN_GUEST_HANDLE(void) name;  /* UCS-2/UTF-16 string */
  196             xen_ulong_t size;
  197             XEN_GUEST_HANDLE(void) data;
  198             struct xenpf_efi_guid vendor_guid;
  199         } get_variable, set_variable;
  200 
  201         struct {
  202             xen_ulong_t size;
  203             XEN_GUEST_HANDLE(void) name;  /* UCS-2/UTF-16 string */
  204             struct xenpf_efi_guid vendor_guid;
  205         } get_next_variable_name;
  206 
  207 #define XEN_EFI_VARINFO_BOOT_SNAPSHOT       0x00000001
  208         struct {
  209             uint32_t attr;
  210             uint64_t max_store_size;
  211             uint64_t remain_store_size;
  212             uint64_t max_size;
  213         } query_variable_info;
  214 
  215         struct {
  216             XEN_GUEST_HANDLE(void) capsule_header_array;
  217             xen_ulong_t capsule_count;
  218             uint64_t max_capsule_size;
  219             uint32_t reset_type;
  220         } query_capsule_capabilities;
  221 
  222         struct {
  223             XEN_GUEST_HANDLE(void) capsule_header_array;
  224             xen_ulong_t capsule_count;
  225             uint64_t sg_list; /* machine address */
  226         } update_capsule;
  227     } u;
  228 };
  229 typedef struct xenpf_efi_runtime_call xenpf_efi_runtime_call_t;
  230 DEFINE_XEN_GUEST_HANDLE(xenpf_efi_runtime_call_t);
  231 
  232 #define XENPF_firmware_info       50
  233 #define XEN_FW_DISK_INFO          1 /* from int 13 AH=08/41/48 */
  234 #define XEN_FW_DISK_MBR_SIGNATURE 2 /* from MBR offset 0x1b8 */
  235 #define XEN_FW_VBEDDC_INFO        3 /* from int 10 AX=4f15 */
  236 #define XEN_FW_EFI_INFO           4 /* from EFI */
  237 #define  XEN_FW_EFI_VERSION        0
  238 #define  XEN_FW_EFI_CONFIG_TABLE   1
  239 #define  XEN_FW_EFI_VENDOR         2
  240 #define  XEN_FW_EFI_MEM_INFO       3
  241 #define  XEN_FW_EFI_RT_VERSION     4
  242 #define  XEN_FW_EFI_PCI_ROM        5
  243 #define XEN_FW_KBD_SHIFT_FLAGS    5
  244 struct xenpf_firmware_info {
  245     /* IN variables. */
  246     uint32_t type;
  247     uint32_t index;
  248     /* OUT variables. */
  249     union {
  250         struct {
  251             /* Int13, Fn48: Check Extensions Present. */
  252             uint8_t device;                   /* %dl: bios device number */
  253             uint8_t version;                  /* %ah: major version      */
  254             uint16_t interface_support;       /* %cx: support bitmap     */
  255             /* Int13, Fn08: Legacy Get Device Parameters. */
  256             uint16_t legacy_max_cylinder;     /* %cl[7:6]:%ch: max cyl # */
  257             uint8_t legacy_max_head;          /* %dh: max head #         */
  258             uint8_t legacy_sectors_per_track; /* %cl[5:0]: max sector #  */
  259             /* Int13, Fn41: Get Device Parameters (as filled into %ds:%esi). */
  260             /* NB. First uint16_t of buffer must be set to buffer size.      */
  261             XEN_GUEST_HANDLE(void) edd_params;
  262         } disk_info; /* XEN_FW_DISK_INFO */
  263         struct {
  264             uint8_t device;                   /* bios device number  */
  265             uint32_t mbr_signature;           /* offset 0x1b8 in mbr */
  266         } disk_mbr_signature; /* XEN_FW_DISK_MBR_SIGNATURE */
  267         struct {
  268             /* Int10, AX=4F15: Get EDID info. */
  269             uint8_t capabilities;
  270             uint8_t edid_transfer_time;
  271             /* must refer to 128-byte buffer */
  272             XEN_GUEST_HANDLE(uint8) edid;
  273         } vbeddc_info; /* XEN_FW_VBEDDC_INFO */
  274         union xenpf_efi_info {
  275             uint32_t version;
  276             struct {
  277                 uint64_t addr;                /* EFI_CONFIGURATION_TABLE */
  278                 uint32_t nent;
  279             } cfg;
  280             struct {
  281                 uint32_t revision;
  282                 uint32_t bufsz;               /* input, in bytes */
  283                 XEN_GUEST_HANDLE(void) name;  /* UCS-2/UTF-16 string */
  284             } vendor;
  285             struct {
  286                 uint64_t addr;
  287                 uint64_t size;
  288                 uint64_t attr;
  289                 uint32_t type;
  290             } mem;
  291             struct {
  292                 /* IN variables */
  293                 uint16_t segment;
  294                 uint8_t bus;
  295                 uint8_t devfn;
  296                 uint16_t vendor;
  297                 uint16_t devid;
  298                 /* OUT variables */
  299                 uint64_t address;
  300                 xen_ulong_t size;
  301             } pci_rom;
  302         } efi_info; /* XEN_FW_EFI_INFO */
  303 
  304         /* Int16, Fn02: Get keyboard shift flags. */
  305         uint8_t kbd_shift_flags; /* XEN_FW_KBD_SHIFT_FLAGS */
  306     } u;
  307 };
  308 typedef struct xenpf_firmware_info xenpf_firmware_info_t;
  309 DEFINE_XEN_GUEST_HANDLE(xenpf_firmware_info_t);
  310 
  311 #define XENPF_enter_acpi_sleep    51
  312 struct xenpf_enter_acpi_sleep {
  313     /* IN variables */
  314 #if __XEN_INTERFACE_VERSION__ < 0x00040300
  315     uint16_t pm1a_cnt_val;      /* PM1a control value. */
  316     uint16_t pm1b_cnt_val;      /* PM1b control value. */
  317 #else
  318     uint16_t val_a;             /* PM1a control / sleep type A. */
  319     uint16_t val_b;             /* PM1b control / sleep type B. */
  320 #endif
  321     uint32_t sleep_state;       /* Which state to enter (Sn). */
  322 #define XENPF_ACPI_SLEEP_EXTENDED 0x00000001
  323     uint32_t flags;             /* XENPF_ACPI_SLEEP_*. */
  324 };
  325 typedef struct xenpf_enter_acpi_sleep xenpf_enter_acpi_sleep_t;
  326 DEFINE_XEN_GUEST_HANDLE(xenpf_enter_acpi_sleep_t);
  327 
  328 #define XENPF_change_freq         52
  329 struct xenpf_change_freq {
  330     /* IN variables */
  331     uint32_t flags; /* Must be zero. */
  332     uint32_t cpu;   /* Physical cpu. */
  333     uint64_t freq;  /* New frequency (Hz). */
  334 };
  335 typedef struct xenpf_change_freq xenpf_change_freq_t;
  336 DEFINE_XEN_GUEST_HANDLE(xenpf_change_freq_t);
  337 
  338 /*
  339  * Get idle times (nanoseconds since boot) for physical CPUs specified in the
  340  * @cpumap_bitmap with range [0..@cpumap_nr_cpus-1]. The @idletime array is
  341  * indexed by CPU number; only entries with the corresponding @cpumap_bitmap
  342  * bit set are written to. On return, @cpumap_bitmap is modified so that any
  343  * non-existent CPUs are cleared. Such CPUs have their @idletime array entry
  344  * cleared.
  345  */
  346 #define XENPF_getidletime         53
  347 struct xenpf_getidletime {
  348     /* IN/OUT variables */
  349     /* IN: CPUs to interrogate; OUT: subset of IN which are present */
  350     XEN_GUEST_HANDLE(uint8) cpumap_bitmap;
  351     /* IN variables */
  352     /* Size of cpumap bitmap. */
  353     uint32_t cpumap_nr_cpus;
  354     /* Must be indexable for every cpu in cpumap_bitmap. */
  355     XEN_GUEST_HANDLE(uint64) idletime;
  356     /* OUT variables */
  357     /* System time when the idletime snapshots were taken. */
  358     uint64_t now;
  359 };
  360 typedef struct xenpf_getidletime xenpf_getidletime_t;
  361 DEFINE_XEN_GUEST_HANDLE(xenpf_getidletime_t);
  362 
  363 #define XENPF_set_processor_pminfo      54
  364 
  365 /* ability bits */
  366 #define XEN_PROCESSOR_PM_CX     1
  367 #define XEN_PROCESSOR_PM_PX     2
  368 #define XEN_PROCESSOR_PM_TX     4
  369 
  370 /* cmd type */
  371 #define XEN_PM_CX   0
  372 #define XEN_PM_PX   1
  373 #define XEN_PM_TX   2
  374 #define XEN_PM_PDC  3
  375 
  376 /* Px sub info type */
  377 #define XEN_PX_PCT   1
  378 #define XEN_PX_PSS   2
  379 #define XEN_PX_PPC   4
  380 #define XEN_PX_PSD   8
  381 
  382 struct xen_power_register {
  383     uint32_t     space_id;
  384     uint32_t     bit_width;
  385     uint32_t     bit_offset;
  386     uint32_t     access_size;
  387     uint64_t     address;
  388 };
  389 
  390 struct xen_processor_csd {
  391     uint32_t    domain;      /* domain number of one dependent group */
  392     uint32_t    coord_type;  /* coordination type */
  393     uint32_t    num;         /* number of processors in same domain */
  394 };
  395 typedef struct xen_processor_csd xen_processor_csd_t;
  396 DEFINE_XEN_GUEST_HANDLE(xen_processor_csd_t);
  397 
  398 struct xen_processor_cx {
  399     struct xen_power_register  reg; /* GAS for Cx trigger register */
  400     uint8_t     type;     /* cstate value, c0: 0, c1: 1, ... */
  401     uint32_t    latency;  /* worst latency (ms) to enter/exit this cstate */
  402     uint32_t    power;    /* average power consumption(mW) */
  403     uint32_t    dpcnt;    /* number of dependency entries */
  404     XEN_GUEST_HANDLE(xen_processor_csd_t) dp; /* NULL if no dependency */
  405 };
  406 typedef struct xen_processor_cx xen_processor_cx_t;
  407 DEFINE_XEN_GUEST_HANDLE(xen_processor_cx_t);
  408 
  409 struct xen_processor_flags {
  410     uint32_t bm_control:1;
  411     uint32_t bm_check:1;
  412     uint32_t has_cst:1;
  413     uint32_t power_setup_done:1;
  414     uint32_t bm_rld_set:1;
  415 };
  416 
  417 struct xen_processor_power {
  418     uint32_t count;  /* number of C state entries in array below */
  419     struct xen_processor_flags flags;  /* global flags of this processor */
  420     XEN_GUEST_HANDLE(xen_processor_cx_t) states; /* supported c states */
  421 };
  422 
  423 struct xen_pct_register {
  424     uint8_t  descriptor;
  425     uint16_t length;
  426     uint8_t  space_id;
  427     uint8_t  bit_width;
  428     uint8_t  bit_offset;
  429     uint8_t  reserved;
  430     uint64_t address;
  431 };
  432 
  433 struct xen_processor_px {
  434     uint64_t core_frequency; /* megahertz */
  435     uint64_t power;      /* milliWatts */
  436     uint64_t transition_latency; /* microseconds */
  437     uint64_t bus_master_latency; /* microseconds */
  438     uint64_t control;        /* control value */
  439     uint64_t status;     /* success indicator */
  440 };
  441 typedef struct xen_processor_px xen_processor_px_t;
  442 DEFINE_XEN_GUEST_HANDLE(xen_processor_px_t);
  443 
  444 struct xen_psd_package {
  445     uint64_t num_entries;
  446     uint64_t revision;
  447     uint64_t domain;
  448     uint64_t coord_type;
  449     uint64_t num_processors;
  450 };
  451 
  452 struct xen_processor_performance {
  453     uint32_t flags;     /* flag for Px sub info type */
  454     uint32_t platform_limit;  /* Platform limitation on freq usage */
  455     struct xen_pct_register control_register;
  456     struct xen_pct_register status_register;
  457     uint32_t state_count;     /* total available performance states */
  458     XEN_GUEST_HANDLE(xen_processor_px_t) states;
  459     struct xen_psd_package domain_info;
  460     uint32_t shared_type;     /* coordination type of this processor */
  461 };
  462 typedef struct xen_processor_performance xen_processor_performance_t;
  463 DEFINE_XEN_GUEST_HANDLE(xen_processor_performance_t);
  464 
  465 struct xenpf_set_processor_pminfo {
  466     /* IN variables */
  467     uint32_t id;    /* ACPI CPU ID */
  468     uint32_t type;  /* {XEN_PM_CX, XEN_PM_PX} */
  469     union {
  470         struct xen_processor_power          power;/* Cx: _CST/_CSD */
  471         struct xen_processor_performance    perf; /* Px: _PPC/_PCT/_PSS/_PSD */
  472         XEN_GUEST_HANDLE(uint32)            pdc;  /* _PDC */
  473     } u;
  474 };
  475 typedef struct xenpf_set_processor_pminfo xenpf_set_processor_pminfo_t;
  476 DEFINE_XEN_GUEST_HANDLE(xenpf_set_processor_pminfo_t);
  477 
  478 #define XENPF_get_cpuinfo 55
  479 struct xenpf_pcpuinfo {
  480     /* IN */
  481     uint32_t xen_cpuid;
  482     /* OUT */
  483     /* The maxium cpu_id that is present */
  484     uint32_t max_present;
  485 #define XEN_PCPU_FLAGS_ONLINE   1
  486     /* Correponding xen_cpuid is not present*/
  487 #define XEN_PCPU_FLAGS_INVALID  2
  488     uint32_t flags;
  489     uint32_t apic_id;
  490     uint32_t acpi_id;
  491 };
  492 typedef struct xenpf_pcpuinfo xenpf_pcpuinfo_t;
  493 DEFINE_XEN_GUEST_HANDLE(xenpf_pcpuinfo_t);
  494 
  495 #define XENPF_get_cpu_version 48
  496 struct xenpf_pcpu_version {
  497     /* IN */
  498     uint32_t xen_cpuid;
  499     /* OUT */
  500     /* The maxium cpu_id that is present */
  501     uint32_t max_present;
  502     char vendor_id[12];
  503     uint32_t family;
  504     uint32_t model;
  505     uint32_t stepping;
  506 };
  507 typedef struct xenpf_pcpu_version xenpf_pcpu_version_t;
  508 DEFINE_XEN_GUEST_HANDLE(xenpf_pcpu_version_t);
  509 
  510 #define XENPF_cpu_online    56
  511 #define XENPF_cpu_offline   57
  512 struct xenpf_cpu_ol
  513 {
  514     uint32_t cpuid;
  515 };
  516 typedef struct xenpf_cpu_ol xenpf_cpu_ol_t;
  517 DEFINE_XEN_GUEST_HANDLE(xenpf_cpu_ol_t);
  518 
  519 #define XENPF_cpu_hotadd    58
  520 struct xenpf_cpu_hotadd
  521 {
  522         uint32_t apic_id;
  523         uint32_t acpi_id;
  524         uint32_t pxm;
  525 };
  526 
  527 #define XENPF_mem_hotadd    59
  528 struct xenpf_mem_hotadd
  529 {
  530     uint64_t spfn;
  531     uint64_t epfn;
  532     uint32_t pxm;
  533     uint32_t flags;
  534 };
  535 
  536 #define XENPF_core_parking  60
  537 
  538 #define XEN_CORE_PARKING_SET 1
  539 #define XEN_CORE_PARKING_GET 2
  540 struct xenpf_core_parking {
  541     /* IN variables */
  542     uint32_t type;
  543     /* IN variables:  set cpu nums expected to be idled */
  544     /* OUT variables: get cpu nums actually be idled */
  545     uint32_t idle_nums;
  546 };
  547 typedef struct xenpf_core_parking xenpf_core_parking_t;
  548 DEFINE_XEN_GUEST_HANDLE(xenpf_core_parking_t);
  549 
  550 /*
  551  * Access generic platform resources(e.g., accessing MSR, port I/O, etc)
  552  * in unified way. Batch resource operations in one call are supported and
  553  * they are always non-preemptible and executed in their original order.
  554  * The batch itself returns a negative integer for general errors, or a
  555  * non-negative integer for the number of successful operations. For the latter
  556  * case, the @ret in the failed entry (if any) indicates the exact error.
  557  */
  558 #define XENPF_resource_op   61
  559 
  560 #define XEN_RESOURCE_OP_MSR_READ  0
  561 #define XEN_RESOURCE_OP_MSR_WRITE 1
  562 
  563 /*
  564  * Specially handled MSRs:
  565  * - MSR_IA32_TSC
  566  * READ: Returns the scaled system time(ns) instead of raw timestamp. In
  567  *       multiple entry case, if other MSR read is followed by a MSR_IA32_TSC
  568  *       read, then both reads are guaranteed to be performed atomically (with
  569  *       IRQ disabled). The return time indicates the point of reading that MSR.
  570  * WRITE: Not supported.
  571  */
  572 
  573 struct xenpf_resource_entry {
  574     union {
  575         uint32_t cmd;   /* IN: XEN_RESOURCE_OP_* */
  576         int32_t  ret;   /* OUT: return value for failed entry */
  577     } u;
  578     uint32_t rsvd;      /* IN: padding and must be zero */
  579     uint64_t idx;       /* IN: resource address to access */
  580     uint64_t val;       /* IN/OUT: resource value to set/get */
  581 };
  582 typedef struct xenpf_resource_entry xenpf_resource_entry_t;
  583 DEFINE_XEN_GUEST_HANDLE(xenpf_resource_entry_t);
  584 
  585 struct xenpf_resource_op {
  586     uint32_t nr_entries;    /* number of resource entry */
  587     uint32_t cpu;           /* which cpu to run */
  588     XEN_GUEST_HANDLE(xenpf_resource_entry_t) entries;
  589 };
  590 typedef struct xenpf_resource_op xenpf_resource_op_t;
  591 DEFINE_XEN_GUEST_HANDLE(xenpf_resource_op_t);
  592 
  593 #define XENPF_get_symbol   63
  594 struct xenpf_symdata {
  595     /* IN/OUT variables */
  596     uint32_t namelen; /* IN:  size of name buffer                       */
  597                       /* OUT: strlen(name) of hypervisor symbol (may be */
  598                       /*      larger than what's been copied to guest)  */
  599     uint32_t symnum;  /* IN:  Symbol to read                            */
  600                       /* OUT: Next available symbol. If same as IN then */
  601                       /*      we reached the end                        */
  602 
  603     /* OUT variables */
  604     XEN_GUEST_HANDLE(char) name;
  605     uint64_t address;
  606     char type;
  607 };
  608 typedef struct xenpf_symdata xenpf_symdata_t;
  609 DEFINE_XEN_GUEST_HANDLE(xenpf_symdata_t);
  610 
  611 /*
  612  * ` enum neg_errnoval
  613  * ` HYPERVISOR_platform_op(const struct xen_platform_op*);
  614  */
  615 struct xen_platform_op {
  616     uint32_t cmd;
  617     uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
  618     union {
  619         struct xenpf_settime           settime;
  620         struct xenpf_settime32         settime32;
  621         struct xenpf_settime64         settime64;
  622         struct xenpf_add_memtype       add_memtype;
  623         struct xenpf_del_memtype       del_memtype;
  624         struct xenpf_read_memtype      read_memtype;
  625         struct xenpf_microcode_update  microcode;
  626         struct xenpf_platform_quirk    platform_quirk;
  627         struct xenpf_efi_runtime_call  efi_runtime_call;
  628         struct xenpf_firmware_info     firmware_info;
  629         struct xenpf_enter_acpi_sleep  enter_acpi_sleep;
  630         struct xenpf_change_freq       change_freq;
  631         struct xenpf_getidletime       getidletime;
  632         struct xenpf_set_processor_pminfo set_pminfo;
  633         struct xenpf_pcpuinfo          pcpu_info;
  634         struct xenpf_pcpu_version      pcpu_version;
  635         struct xenpf_cpu_ol            cpu_ol;
  636         struct xenpf_cpu_hotadd        cpu_add;
  637         struct xenpf_mem_hotadd        mem_add;
  638         struct xenpf_core_parking      core_parking;
  639         struct xenpf_resource_op       resource_op;
  640         struct xenpf_symdata           symdata;
  641         uint8_t                        pad[128];
  642     } u;
  643 };
  644 typedef struct xen_platform_op xen_platform_op_t;
  645 DEFINE_XEN_GUEST_HANDLE(xen_platform_op_t);
  646 
  647 #endif /* __XEN_PUBLIC_PLATFORM_H__ */
  648 
  649 /*
  650  * Local variables:
  651  * mode: C
  652  * c-file-style: "BSD"
  653  * c-basic-offset: 4
  654  * tab-width: 4
  655  * indent-tabs-mode: nil
  656  * End:
  657  */

Cache object: 4bc30d703c7aee1da550079aac8a260f


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.