Date: Mon, 6 May 2013 21:13:22 +0000 (UTC) From: Jung-uk Kim <jkim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250311 - stable/8/sys/compat/x86bios Message-ID: <201305062113.r46LDM7A068762@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jkim Date: Mon May 6 21:13:22 2013 New Revision: 250311 URL: http://svnweb.freebsd.org/changeset/base/250311 Log: MFC: r210877 (partial) Decrease emulated stack size from 64K to 4K bytes. Modified: stable/8/sys/compat/x86bios/x86bios.c stable/8/sys/compat/x86bios/x86bios.h Modified: stable/8/sys/compat/x86bios/x86bios.c ============================================================================== --- stable/8/sys/compat/x86bios/x86bios.c Mon May 6 21:04:42 2013 (r250310) +++ stable/8/sys/compat/x86bios/x86bios.c Mon May 6 21:13:22 2013 (r250311) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #define X86BIOS_PAGE_SIZE 0x00001000 /* 4K */ #define X86BIOS_IVT_SIZE 0x00000500 /* 1K + 256 (BDA) */ -#define X86BIOS_SEG_SIZE 0x00010000 /* 64K */ #define X86BIOS_MEM_SIZE 0x00100000 /* 1M */ #define X86BIOS_IVT_BASE 0x00000000 @@ -63,11 +62,12 @@ __FBSDID("$FreeBSD$"); #define X86BIOS_ROM_BASE 0x000a0000 #define X86BIOS_ROM_SIZE (X86BIOS_MEM_SIZE - (uint32_t)x86bios_rom_phys) +#define X86BIOS_SEG_SIZE X86BIOS_PAGE_SIZE #define X86BIOS_PAGES (X86BIOS_MEM_SIZE / X86BIOS_PAGE_SIZE) -#define X86BIOS_R_DS _pad1 #define X86BIOS_R_SS _pad2 +#define X86BIOS_R_SP _pad3.I16_reg.x_reg static struct x86emu x86bios_emu; @@ -332,8 +332,8 @@ x86bios_init_regs(struct x86regs *regs) { bzero(regs, sizeof(*regs)); - regs->X86BIOS_R_DS = 0x40; - regs->X86BIOS_R_SS = x86bios_seg_phys >> 4; + regs->X86BIOS_R_SS = X86BIOS_PHYSTOSEG(x86bios_seg_phys); + regs->X86BIOS_R_SP = X86BIOS_PAGE_SIZE - 2; } void Modified: stable/8/sys/compat/x86bios/x86bios.h ============================================================================== --- stable/8/sys/compat/x86bios/x86bios.h Mon May 6 21:04:42 2013 (r250310) +++ stable/8/sys/compat/x86bios/x86bios.h Mon May 6 21:13:22 2013 (r250311) @@ -138,8 +138,8 @@ typedef struct x86regs x86regs_t; #define R_FS register_fs #define R_GS register_gs -#define X86BIOS_PHYSTOSEG(x) (((x) >> 4) & 0xffff) -#define X86BIOS_PHYSTOOFF(x) ((x) & 0x000f) +#define X86BIOS_PHYSTOSEG(x) (((x) >> 4) & 0xff00) +#define X86BIOS_PHYSTOOFF(x) ((x) & 0x0fff) __BEGIN_DECLS void *x86bios_alloc(uint32_t *offset, size_t size);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305062113.r46LDM7A068762>