~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/openbios/arch/amd64/segment.h

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/* Segment indexes. Must match the gdt definition in segment.c. */
 
3
enum {
 
4
    NULL_SEG,
 
5
    FLAT_CODE,
 
6
    FLAT_DATA,
 
7
    RELOC_CODE,
 
8
    RELOC_DATA,
 
9
    NUM_SEG,
 
10
};
 
11
 
 
12
/* Values for segment selector register */
 
13
#define FLAT_CS (FLAT_CODE << 3)
 
14
#define FLAT_DS (FLAT_DATA << 3)
 
15
#define RELOC_CS (RELOC_CODE << 3)
 
16
#define RELOC_DS (RELOC_DATA << 3)
 
17
 
 
18
/* i386 segment descriptor */
 
19
struct segment_desc {
 
20
    unsigned short limit_0;
 
21
    unsigned short base_0;
 
22
    unsigned char base_16;
 
23
    unsigned char types;
 
24
    unsigned char flags;
 
25
    unsigned char base_24;
 
26
};
 
27
 
 
28
extern struct segment_desc gdt[NUM_SEG];
 
29
 
 
30
#define GDT_LIMIT ((NUM_SEG << 3) - 1)