kern

diff src/segm.h @ 7:611b2d66420b

segment descriptors
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 16 Feb 2011 07:26:03 +0200
parents
children 78d5c304ddd0
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/segm.h	Wed Feb 16 07:26:03 2011 +0200
     1.3 @@ -0,0 +1,21 @@
     1.4 +#ifndef SEGM_H_
     1.5 +#define SEGM_H_
     1.6 +
     1.7 +#define SEGM_KCODE	1
     1.8 +#define SEGM_KDATA	2
     1.9 +
    1.10 +typedef struct {
    1.11 +	uint16_t d[4];
    1.12 +} desc_t;
    1.13 +
    1.14 +void init_segm(void);
    1.15 +
    1.16 +uint16_t selector(int idx, int rpl);
    1.17 +
    1.18 +/* these functions are implemented in segm-asm.S */
    1.19 +void setup_selectors(uint16_t code, uint16_t data);
    1.20 +void set_gdt(uint32_t addr, uint16_t limit);
    1.21 +
    1.22 +
    1.23 +
    1.24 +#endif	/* SEGM_H_ */