Skip to contentSkip to conversation

add hypercall function for retrieving EDD info

PATCH New Jan Beulich 1 participant 1 message Jun 19, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 add hypercall function for retrieving EDD info

xen/arch/x86/boot/edd.S +3 -6
Index: 2007-06-18/xen/arch/x86/boot/edd.S
===================================================================
@@ -16,17 +16,13 @@
  * Updated and ported for Xen by Keir Fraser <[email protected]> June 2007
  */
 
+#include <asm/edd.h>
+
         .code16
 
 /* Offset of disc signature in the MBR. */
 #define EDD_MBR_SIG_OFFSET      0x1B8
 
-/* Maximum number of EDD information structures at boot_edd_info. */
-#define EDD_INFO_MAX            6
-
-/* Maximum number of MBR signatures at boot_edd_signature. */
-#define EDD_MBR_SIG_MAX         16
-
 /* Size of components of EDD information structure. */
 #define EDDEXTSIZE              8
 #define EDDPARMSIZE             74
@@ -151,6 +147,7 @@ opt_edd:
         .byte   0                               # edd=on/off/skipmbr
 
 .globl  boot_edd_info_nr, boot_edd_signature_nr
+.globl  boot_edd_info, boot_edd_signature
 boot_edd_info_nr:
         .byte   0
 boot_edd_signature_nr:
xen/arch/x86/platform_hypercall.c +94 -0

120 lines not on this page · raw message

xen/include/asm-x86/edd.h +118 -3

136 lines not on this page · raw message

xen/include/public/platform.h +30 -0
Index: 2007-06-18/xen/include/public/platform.h
===================================================================
@@ -114,6 +114,35 @@ struct xenpf_platform_quirk {
 typedef struct xenpf_platform_quirk xenpf_platform_quirk_t;
 DEFINE_XEN_GUEST_HANDLE(xenpf_platform_quirk_t);
 
+#define XENPF_firmware_info       50
+#define XEN_FW_DISK_INFO          1 /* from int 13 AH=08 */
+#define XEN_FW_EDD_INFO           2 /* from int 13 AH=41 */
+#define XEN_FW_EDD_PARAMS         3 /* from int 13 AH=48 */
+#define XEN_FW_MBR_SIGNATURE      4
+struct xenpf_firmware_info {
+    /* IN variables. */
+    uint32_t type;
+    uint32_t index;
+    /* OUT variables. */
+    union {
+        struct {
+            uint16_t max_cylinder;
+            uint8_t max_head;
+            uint8_t sectors_per_track;
+        } disk_info;
+        struct {
+            uint8_t device;
+            uint8_t version;
+            uint16_t interface;
+        } edd_info;
+        /* first uint16_t of buffer must be set to buffer size */
+        XEN_GUEST_HANDLE(void) edd_params;
+        uint32_t mbr_signature;
+    } u;
+};
+typedef struct xenpf_firmware_info xenpf_firmware_info_t;
+DEFINE_XEN_GUEST_HANDLE(xenpf_firmware_info_t);
+
 struct xen_platform_op {
     uint32_t cmd;
     uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
@@ -124,6 +153,7 @@ struct xen_platform_op {
         struct xenpf_read_memtype      read_memtype;
         struct xenpf_microcode_update  microcode;
         struct xenpf_platform_quirk    platform_quirk;
+        struct xenpf_firmware_info     firmware_info;
         uint8_t                        pad[128];
     } u;
 };