From owner-svn-src-all@FreeBSD.ORG Fri Sep 25 17:56:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 356FD1065783; Fri, 25 Sep 2009 17:56:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24CBC8FC15; Fri, 25 Sep 2009 17:56:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PHuXSo035662; Fri, 25 Sep 2009 17:56:33 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PHuXMv035659; Fri, 25 Sep 2009 17:56:33 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200909251756.n8PHuXMv035659@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 25 Sep 2009 17:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197493 - head/sys/compat/x86bios X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 17:56:33 -0000 Author: jkim Date: Fri Sep 25 17:56:32 2009 New Revision: 197493 URL: http://svn.freebsd.org/changeset/base/197493 Log: - Reduce BIOS memory mapping. We want 1MB of physical memory, not 12MB[1]. - Remove CS and IP registers from x86bios.h. They have no use for us. - Adjust register dump to make it little bit more useful for debugging. Submitted by: paradox (ddkprog yahoo com)[1] (initial version) Modified: head/sys/compat/x86bios/x86bios.c head/sys/compat/x86bios/x86bios.h Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Fri Sep 25 17:56:13 2009 (r197492) +++ head/sys/compat/x86bios/x86bios.c Fri Sep 25 17:56:32 2009 (r197493) @@ -98,9 +98,10 @@ x86bios_intr(struct x86regs *regs, int i return; if (bootverbose) - printf("Calling real mode int 0x%x " - "(ax=0x%04x bx=0x%04x cx=0x%04x dx=0x%04x)\n", - intno, regs->R_AX, regs->R_BX, regs->R_CX, regs->R_DX); + printf("Calling int 0x%x (ax=0x%04x bx=0x%04x " + "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", + intno, regs->R_AX, regs->R_BX, regs->R_CX, + regs->R_DX, regs->R_ES, regs->R_DI); mtx_lock_spin(&x86bios_lock); @@ -111,9 +112,10 @@ x86bios_intr(struct x86regs *regs, int i mtx_unlock_spin(&x86bios_lock); if (bootverbose) - printf("Exiting real mode int 0x%x " - "(ax=0x%04x bx=0x%04x cx=0x%04x dx=0x%04x)\n", - intno, regs->R_AX, regs->R_BX, regs->R_CX, regs->R_DX); + printf("Exiting int 0x%x (ax=0x%04x bx=0x%04x " + "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", + intno, regs->R_AX, regs->R_BX, regs->R_CX, + regs->R_DX, regs->R_ES, regs->R_DI); } void * @@ -144,7 +146,7 @@ x86bios_init(void *arg __unused) x86bios_emu.emu_outl = x86bios_emu_outl; x86bios_emu.mem_base = (char *)pbiosMem; - x86bios_emu.mem_size = 1024 * 1024; + x86bios_emu.mem_size = MAPPED_MEMORY_SIZE; memset(busySegMap, 0, sizeof(busySegMap)); Modified: head/sys/compat/x86bios/x86bios.h ============================================================================== --- head/sys/compat/x86bios/x86bios.h Fri Sep 25 17:56:13 2009 (r197492) +++ head/sys/compat/x86bios/x86bios.h Fri Sep 25 17:56:32 2009 (r197493) @@ -54,7 +54,7 @@ union x86_register { }; struct x86regs { - uint16_t register_cs; + uint16_t padding; /* CS is unused. */ uint16_t register_ds; uint16_t register_es; uint16_t register_fs; @@ -70,7 +70,6 @@ struct x86regs { union x86_register register_bp; union x86_register register_si; union x86_register register_di; - union x86_register register_ip; }; typedef struct x86regs x86regs_t; @@ -102,7 +101,6 @@ typedef struct x86regs x86regs_t; #define R_BP register_bp.I16_reg.x_reg #define R_SI register_si.I16_reg.x_reg #define R_DI register_di.I16_reg.x_reg -#define R_IP register_ip.I16_reg.x_reg #define R_FLG register_flags /* special registers */ @@ -110,11 +108,9 @@ typedef struct x86regs x86regs_t; #define R_EBP register_bp.I32_reg.e_reg #define R_ESI register_si.I32_reg.e_reg #define R_EDI register_di.I32_reg.e_reg -#define R_EIP register_ip.I32_reg.e_reg #define R_EFLG register_flags /* segment registers */ -#define R_CS register_cs #define R_DS register_ds #define R_SS register_ss #define R_ES register_es @@ -125,8 +121,8 @@ typedef struct x86regs x86regs_t; #define SEG_OFF(x) ((x) & 0x0FFFF) #define FARP(x) ((le32toh(x) & 0xffff) + ((le32toh(x) >> 12) & 0xffff00)) -#define MAPPED_MEMORY_SIZE 0xc00000 -#define PAGE_RESERV (4096*5) +#define MAPPED_MEMORY_SIZE (1024 * 1024) +#define PAGE_RESERV (4096 * 5) __BEGIN_DECLS void *x86bios_alloc(int count, int *segs);