--- np2/i386c/ia32/segments.c 2008/03/22 04:03:08 1.19 +++ np2/i386c/ia32/segments.c 2012/01/08 18:26:55 1.23 @@ -1,5 +1,3 @@ -/* $Id: segments.c,v 1.19 2008/03/22 04:03:08 monaka Exp $ */ - /* * Copyright (c) 2003 NONAKA Kimihiro * All rights reserved. @@ -30,7 +28,7 @@ #include "ia32.mcr" -void +void CPUCALL load_segreg(int idx, UINT16 selector, UINT16 *sregp, descriptor_t *sdp, int exc) { selector_t sel; @@ -124,7 +122,7 @@ load_segreg(int idx, UINT16 selector, UI /* * load SS register */ -void +void CPUCALL load_ss(UINT16 selector, const descriptor_t *sdp, int cpl) { @@ -136,7 +134,7 @@ load_ss(UINT16 selector, const descripto /* * load CS register */ -void +void CPUCALL load_cs(UINT16 selector, const descriptor_t *sdp, int new_cpl) { int cpl = new_cpl & 3; @@ -152,7 +150,7 @@ load_cs(UINT16 selector, const descripto /* * load LDT register */ -void +void CPUCALL load_ldtr(UINT16 selector, int exc) { selector_t sel; @@ -164,6 +162,7 @@ load_ldtr(UINT16 selector, int exc) if (rv < 0 || sel.ldt) { if (rv == -2) { /* null segment */ + VERBOSE(("load_ldtr: null segment")); CPU_LDTR = 0; memset(&CPU_LDTR_DESC, 0, sizeof(CPU_LDTR_DESC)); return; @@ -191,7 +190,7 @@ load_ldtr(UINT16 selector, int exc) CPU_LDTR_DESC = sel.desc; } -void +void CPUCALL load_descriptor(descriptor_t *sdp, UINT32 addr) { UINT32 l, h; @@ -305,7 +304,7 @@ load_descriptor(descriptor_t *sdp, UINT3 #endif } -int +int CPUCALL parse_selector(selector_t *ssp, UINT16 selector) { UINT32 base; @@ -339,7 +338,7 @@ parse_selector(selector_t *ssp, UINT16 s limit = CPU_GDTR_LIMIT; } if (idx + 7 > limit) { - VERBOSE(("parse_selector: segment limit check failed")); + VERBOSE(("parse_selector: segment limit check failed: 0x%08x > 0x%08x", idx + 7, limit)); return -3; } @@ -354,7 +353,7 @@ parse_selector(selector_t *ssp, UINT16 s return 0; } -int +int CPUCALL selector_is_not_present(const selector_t *ssp) { UINT32 h; @@ -377,7 +376,7 @@ selector_is_not_present(const selector_t return 0; } -void +void CPUCALL segdesc_init(int idx, UINT16 sreg, descriptor_t *sdp) { @@ -390,7 +389,7 @@ segdesc_init(int idx, UINT16 sreg, descr segdesc_set_default(idx, sreg, sdp); } -void +void CPUCALL segdesc_set_default(int idx, UINT16 selector, descriptor_t *sdp) {