/[rtmk]/rtmk/i386/i386-segment.h
ViewVC logotype

Diff of /rtmk/i386/i386-segment.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by jrydberg, Mon Jan 7 01:09:57 2002 UTC revision 1.5 by jrydberg, Sat Feb 16 14:58:49 2002 UTC
# Line 1  Line 1 
1  /* GDT/LDT/IDT segment header.  /* GDT/LDT/IDT segment header.
2     Copyright 1999, 2000, 2001 Johan Rydberg, jrydberg@opencores.org.     Copyright 1999, 2000, 2001, 2002 Johan Rydberg, jrydberg@rtmk.org.
3    
4  This program is free software; you can redistribute it and/or modify  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by  it under the terms of the GNU General Public License as published by
# Line 18  Foundation, Inc., 59 Temple Place - Suit Line 18  Foundation, Inc., 59 Temple Place - Suit
18  #ifndef __i386_segments_h  #ifndef __i386_segments_h
19  #define __i386_segments_h 1  #define __i386_segments_h 1
20    
21  #define SZGDT   (8 + NCPUS)  #define SZGDT   (8 + (NCPUS * 2))
22  #define SZIDT   256  #define SZIDT   256
23  #define SZLDT   3  #define SZLDT   3
24    
# Line 33  Foundation, Inc., 59 Temple Place - Suit Line 33  Foundation, Inc., 59 Temple Place - Suit
33    
34  #if !defined(ASSEMBLER)  #if !defined(ASSEMBLER)
35    
36    #include <rtmk/kern-return.h>
37    #include <rtmk/i386/thread-state.h>
38    
39  /* The segment descriptor is represented with a quad word with  /* The segment descriptor is represented with a quad word with
40     the following layout:     the following layout:
41        
# Line 53  struct tss_segment Line 56  struct tss_segment
56    unsigned long ldt, tracetrap, bmoffset;    unsigned long ldt, tracetrap, bmoffset;
57  };  };
58    
 extern struct tss_segment ktss [NCPUS];  
   
59  struct segment_pointer  struct segment_pointer
60  {  {
61    unsigned short limit;    unsigned short limit;
# Line 72  struct segment_descriptor Line 73  struct segment_descriptor
73                  base_high   : 8;    /* base 24..31 */                  base_high   : 8;    /* base 24..31 */
74  };  };
75    
   
76  struct segment_callgate  struct segment_callgate
77  {  {
78    unsigned long offset_low  :16,    unsigned long offset_low  :16,
# Line 146  static __inline__ int get_cs (void) Line 146  static __inline__ int get_cs (void)
146    return (int) cs;    return (int) cs;
147  }  }
148    
 #if NCPUS > 1  
149  extern struct segment_descriptor gdt [SZGDT];  extern struct segment_descriptor gdt [SZGDT];
150  #endif  extern struct tss_segment ktss [NCPUS];
151    
152    struct pcb;
153  extern void segments_init (void);  extern void segments_init (void);
154    
155    /* Convert psuedo descriptors in FAKE to real descriptors.
156       Put the converted descriptors in DESC.  N is the number of descriptors.
157       If N is zero, we run until we find an empty descriptor.  */
158    extern void convert_descriptors (struct segment_descriptor *desc,
159                                     struct segment_pseudo *fake, int n);
160    
161    /* Initialize user LDT segment specified with LDT_STATE. */
162    extern kern_return_t
163      initialize_user_segment (struct pcb *pcb,
164                               struct thread_state_i386_ldt *ldt_state);
165    
166    
167  #endif /* ASSEMBLER */  #endif /* ASSEMBLER */
168    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26