Diff for /np2/i386c/ia32/segments.c between versions 1.19 and 1.24

version 1.19, 2008/03/22 04:03:08 version 1.24, 2012/02/05 02:18:10
Line 1 Line 1
 /*      $Id$    */  
   
 /*  /*
  * Copyright (c) 2003 NONAKA Kimihiro   * Copyright (c) 2003 NONAKA Kimihiro
  * All rights reserved.   * All rights reserved.
Line 30 Line 28
 #include "ia32.mcr"  #include "ia32.mcr"
   
   
 void  void CPUCALL
 load_segreg(int idx, UINT16 selector, UINT16 *sregp, descriptor_t *sdp, int exc)  load_segreg(int idx, UINT16 selector, UINT16 *sregp, descriptor_t *sdp, int exc)
 {  {
         selector_t sel;          selector_t sel;
Line 44  load_segreg(int idx, UINT16 selector, UI Line 42  load_segreg(int idx, UINT16 selector, UI
                 /* real-mode or vm86 mode */                  /* real-mode or vm86 mode */
                 *sregp = selector;                  *sregp = selector;
                 segdesc_clear(&sel.desc);                  segdesc_clear(&sel.desc);
                 sel.desc.u.seg.limit = CPU_STAT_SREGLIMIT(idx);                  sel.desc.u.seg.limit = 0xffff;
                 segdesc_set_default(idx, selector, &sel.desc);                  segdesc_set_default(idx, selector, &sel.desc);
                 *sdp = sel.desc;                  *sdp = sel.desc;
                 return;                  return;
Line 124  load_segreg(int idx, UINT16 selector, UI Line 122  load_segreg(int idx, UINT16 selector, UI
 /*  /*
  * load SS register   * load SS register
  */   */
 void  void CPUCALL
 load_ss(UINT16 selector, const descriptor_t *sdp, int cpl)  load_ss(UINT16 selector, const descriptor_t *sdp, int cpl)
 {  {
   
Line 136  load_ss(UINT16 selector, const descripto Line 134  load_ss(UINT16 selector, const descripto
 /*  /*
  * load CS register   * load CS register
  */   */
 void  void CPUCALL
 load_cs(UINT16 selector, const descriptor_t *sdp, int new_cpl)  load_cs(UINT16 selector, const descriptor_t *sdp, int new_cpl)
 {  {
         int cpl = new_cpl & 3;          int cpl = new_cpl & 3;
Line 152  load_cs(UINT16 selector, const descripto Line 150  load_cs(UINT16 selector, const descripto
 /*  /*
  * load LDT register   * load LDT register
  */   */
 void  void CPUCALL
 load_ldtr(UINT16 selector, int exc)  load_ldtr(UINT16 selector, int exc)
 {  {
         selector_t sel;          selector_t sel;
Line 164  load_ldtr(UINT16 selector, int exc) Line 162  load_ldtr(UINT16 selector, int exc)
         if (rv < 0 || sel.ldt) {          if (rv < 0 || sel.ldt) {
                 if (rv == -2) {                  if (rv == -2) {
                         /* null segment */                          /* null segment */
                           VERBOSE(("load_ldtr: null segment"));
                         CPU_LDTR = 0;                          CPU_LDTR = 0;
                         memset(&CPU_LDTR_DESC, 0, sizeof(CPU_LDTR_DESC));                          memset(&CPU_LDTR_DESC, 0, sizeof(CPU_LDTR_DESC));
                         return;                          return;
Line 191  load_ldtr(UINT16 selector, int exc) Line 190  load_ldtr(UINT16 selector, int exc)
         CPU_LDTR_DESC = sel.desc;          CPU_LDTR_DESC = sel.desc;
 }  }
   
 void  void CPUCALL
 load_descriptor(descriptor_t *sdp, UINT32 addr)  load_descriptor(descriptor_t *sdp, UINT32 addr)
 {  {
         UINT32 l, h;          UINT32 l, h;
Line 305  load_descriptor(descriptor_t *sdp, UINT3 Line 304  load_descriptor(descriptor_t *sdp, UINT3
 #endif  #endif
 }  }
   
 int  int CPUCALL
 parse_selector(selector_t *ssp, UINT16 selector)  parse_selector(selector_t *ssp, UINT16 selector)
 {  {
         UINT32 base;          UINT32 base;
Line 339  parse_selector(selector_t *ssp, UINT16 s Line 338  parse_selector(selector_t *ssp, UINT16 s
                 limit = CPU_GDTR_LIMIT;                  limit = CPU_GDTR_LIMIT;
         }          }
         if (idx + 7 > 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;                  return -3;
         }          }
   
Line 354  parse_selector(selector_t *ssp, UINT16 s Line 353  parse_selector(selector_t *ssp, UINT16 s
         return 0;          return 0;
 }  }
   
 int  int CPUCALL
 selector_is_not_present(const selector_t *ssp)  selector_is_not_present(const selector_t *ssp)
 {  {
         UINT32 h;          UINT32 h;
Line 377  selector_is_not_present(const selector_t Line 376  selector_is_not_present(const selector_t
         return 0;          return 0;
 }  }
   
 void  void CPUCALL
 segdesc_init(int idx, UINT16 sreg, descriptor_t *sdp)  segdesc_init(int idx, UINT16 sreg, descriptor_t *sdp)
 {  {
   
Line 390  segdesc_init(int idx, UINT16 sreg, descr Line 389  segdesc_init(int idx, UINT16 sreg, descr
         segdesc_set_default(idx, sreg, sdp);          segdesc_set_default(idx, sreg, sdp);
 }  }
   
 void  void CPUCALL
 segdesc_set_default(int idx, UINT16 selector, descriptor_t *sdp)  segdesc_set_default(int idx, UINT16 selector, descriptor_t *sdp)
 {  {
   

Removed from v.1.19  
changed lines
  Added in v.1.24


RetroPC.NET-CVS <cvs@retropc.net>