From: "Andrew D. Ball" Subject: [RFC] [PATCH] HVM SMBIOS support 4/6 Date: Fri, 07 Jul 2006 15:38:49 -0400 Message-ID: <1152301129.7155.13.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-WorRkfPYks5c/CPgOgBl" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --=-WorRkfPYks5c/CPgOgBl Content-Type: text/plain Content-Transfer-Encoding: 7bit [HVM] [Firmware] Pick up SMBIOS entry point from 0x9f000 in ROMBIOS. This is needed so that the entry point can be found on a 16-byte boundary in 0xf0000-0xfffff. Signed-off-by: Andrew D. Ball diff -r f91cc71173c5 tools/firmware/rombios/rombios.c --- a/tools/firmware/rombios/rombios.c Thu Jun 22 20:37:33 2006 +++ b/tools/firmware/rombios/rombios.c Fri Jul 7 13:48:13 2006 @@ -9443,6 +9443,43 @@ mov ds, ax ret +#ifdef HVMASSIST + +smbios_init: + push ax + push cx + push es + push ds + push di + push si + + ; If we have SMBIOS data, it will be at address 0x9f000, and this + ; will copy it to the entry point address (smbios_entry_point). + ; This will still copy the memory over if we don't, but that shouldn't + ; hurt anything, as that memory won't have the '_SM_' signature. + mov cx, #0x001f ; 0x1f bytes to copy + mov ax, #0xf000 + mov es, ax ; destination segment is 0xf0000 + mov di, smbios_entry_point ; destination offset + mov ax, #0x9f00 + mov ds, ax ; source segment is 0x9f000 + mov si, #0x0000 ; source offset is 0 + cld + rep + movsb + +smbios_out: + pop si + pop di + pop ds + pop es + pop cx + pop ax + + ret + +#endif + ;; for 'C' strings and other data, insert them here with ;; a the following hack: ;; DATA_SEG_DEFS_HERE @@ -9724,6 +9761,7 @@ #ifdef HVMASSIST call _copy_e820_table + call smbios_init #endif call rom_scan @@ -10834,4 +10872,11 @@ db 0,0,0,0 ;; MP feature bytes 2-5. #endif +; space for SMBIOS entry point (31 bytes) +.align 16 +smbios_entry_point: +db 0,0,0,0,0,0,0,0,0,0 +db 0,0,0,0,0,0,0,0,0,0 +db 0,0,0,0,0,0,0,0,0,0,0 + ASM_END --=-WorRkfPYks5c/CPgOgBl Content-Disposition: attachment; filename=smbios_4_rombios.patch Content-Type: text/x-patch; name=smbios_4_rombios.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit [HVM] [Firmware] Pick up SMBIOS entry point from 0x9f000 in ROMBIOS. This is needed so that the entry point can be found on a 16-byte boundary in 0xf0000-0xfffff. Signed-off-by: Andrew D. Ball diff -r f91cc71173c5 tools/firmware/rombios/rombios.c --- a/tools/firmware/rombios/rombios.c Thu Jun 22 20:37:33 2006 +++ b/tools/firmware/rombios/rombios.c Fri Jul 7 13:48:13 2006 @@ -9443,6 +9443,43 @@ mov ds, ax ret +#ifdef HVMASSIST + +smbios_init: + push ax + push cx + push es + push ds + push di + push si + + ; If we have SMBIOS data, it will be at address 0x9f000, and this + ; will copy it to the entry point address (smbios_entry_point). + ; This will still copy the memory over if we don't, but that shouldn't + ; hurt anything, as that memory won't have the '_SM_' signature. + mov cx, #0x001f ; 0x1f bytes to copy + mov ax, #0xf000 + mov es, ax ; destination segment is 0xf0000 + mov di, smbios_entry_point ; destination offset + mov ax, #0x9f00 + mov ds, ax ; source segment is 0x9f000 + mov si, #0x0000 ; source offset is 0 + cld + rep + movsb + +smbios_out: + pop si + pop di + pop ds + pop es + pop cx + pop ax + + ret + +#endif + ;; for 'C' strings and other data, insert them here with ;; a the following hack: ;; DATA_SEG_DEFS_HERE @@ -9724,6 +9761,7 @@ #ifdef HVMASSIST call _copy_e820_table + call smbios_init #endif call rom_scan @@ -10834,4 +10872,11 @@ db 0,0,0,0 ;; MP feature bytes 2-5. #endif +; space for SMBIOS entry point (31 bytes) +.align 16 +smbios_entry_point: +db 0,0,0,0,0,0,0,0,0,0 +db 0,0,0,0,0,0,0,0,0,0 +db 0,0,0,0,0,0,0,0,0,0,0 + ASM_END --=-WorRkfPYks5c/CPgOgBl Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-WorRkfPYks5c/CPgOgBl--