--- np2/i386c/ia32/segments.c 2004/03/04 15:20:13 1.14 +++ np2/i386c/ia32/segments.c 2008/01/25 17:53:27 1.18 @@ -1,4 +1,4 @@ -/* $Id: segments.c,v 1.14 2004/03/04 15:20:13 yui Exp $ */ +/* $Id: segments.c,v 1.18 2008/01/25 17:53:27 monaka Exp $ */ /* * Copyright (c) 2003 NONAKA Kimihiro @@ -12,8 +12,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -131,7 +129,7 @@ load_segreg(int idx, UINT16 selector, in * load SS register */ void -load_ss(UINT16 selector, descriptor_t *sd, UINT cpl) +load_ss(UINT16 selector, const descriptor_t *sd, UINT cpl) { CPU_STAT_SS32 = sd->d; @@ -143,7 +141,7 @@ load_ss(UINT16 selector, descriptor_t *s * load CS register */ void -load_cs(UINT16 selector, descriptor_t *sd, UINT cpl) +load_cs(UINT16 selector, const descriptor_t *sd, UINT cpl) { CPU_INST_OP32 = CPU_INST_AS32 = @@ -179,10 +177,18 @@ load_ldtr(UINT16 selector, int exc) EXCEPTION(exc, sel.selector); } +#if 0 + /* + * LEMM の挙動より LDT セグメントのリミットチェック処理を無効化 + * + * 症状1:リミット 0 の LDT セレクタを LLDT は駄目っぽい。 + * 対策1:リミット 0 の LDT セレクタの代わりにヌルセレクタを LLDT。 + */ /* check limit */ if (sel.desc.u.seg.limit < 7) { ia32_panic("load_ldtr: LDTR descriptor limit < 7 (limit = %d)", sel.desc.u.seg.limit); } +#endif /* not present */ rv = selector_is_not_present(&sel); @@ -319,9 +325,6 @@ load_descriptor(descriptor_t *descp, UIN case 0: case 8: case 10: case 13: /* reserved */ default: descp->valid = 0; - if (descp->p) { // ---- for test! - ia32_panic("load_descriptor: bad descriptor (type = %d)", descp->type); - } break; } } @@ -377,7 +380,7 @@ parse_selector(selector_t *ssp, UINT16 s } int -selector_is_not_present(selector_t *ssp) +selector_is_not_present(const selector_t *ssp) { UINT32 h;