RTEMS
5.1
|
Intel I386 CPU Dependent Source. More...
#include <rtems/score/interrupts.h>
#include <rtems/score/registers.h>
#include <rtems/score/idtr.h>
Go to the source code of this file.
Data Structures | |
struct | __rtems_raw_irq_connect_data__ |
struct | rtems_raw_irq_global_settings |
struct | RTEMS_PACKED |
Used for passing and retrieving registers content to/from real mode interrupt call. More... | |
struct | la_bits |
union | linear_address |
struct | page_dir_bits |
union | page_dir_entry |
struct | page_table_bits |
union | page_table_entry |
struct | page_directory |
struct | page_table |
Macros | |
#define | I386_HAS_FPU 1 |
#define | I386_HAS_BSWAP 1 |
#define | CPU_NAME "Intel i386" |
#define | CPU_swap_u32(_value) i386_swap_u32( _value ) |
#define | CPU_swap_u16(_value) i386_swap_u16( _value ) |
#define | i386_outport_byte(_port, _value) |
#define | i386_outport_word(_port, _value) |
#define | i386_outport_long(_port, _value) |
#define | i386_inport_byte(_port, _value) |
#define | i386_inport_word(_port, _value) |
#define | i386_inport_long(_port, _value) |
#define | PG_SIZE 0x1000 |
#define | MASK_OFFSET 0xFFF |
#define | MAX_ENTRY (PG_SIZE/sizeof(page_dir_entry)) |
#define | FOUR_MB 0x400000 |
#define | MASK_FLAGS 0x1A |
#define | PTE_PRESENT 0x01 |
#define | PTE_WRITABLE 0x02 |
#define | PTE_USER 0x04 |
#define | PTE_WRITE_THROUGH 0x08 |
#define | PTE_CACHE_DISABLE 0x10 |
#define | outport_byte(_port, _value) i386_outport_byte( _port, _value ) |
#define | outport_word(_port, _value) i386_outport_word( _port, _value ) |
#define | outport_long(_port, _value) i386_outport_long( _port, _value ) |
#define | inport_byte(_port, _value) i386_inport_byte( _port, _value ) |
#define | inport_word(_port, _value) i386_inport_word( _port, _value ) |
#define | inport_long(_port, _value) i386_inport_long( _port, _value ) |
Typedefs | |
typedef unsigned char | rtems_vector_offset |
typedef struct __rtems_raw_irq_connect_data__ | rtems_raw_irq_connect_data |
Functions | |
void * | i386_Logical_to_physical (unsigned short segment, void *address) |
void * | i386_Physical_to_logical (unsigned short segment, void *address) |
RTEMS_INLINE_ROUTINE void * | i386_Real_to_physical (uint16_t segment, uint16_t offset) |
Converts real mode pointer {segment, offset} to physical address. More... | |
int | i386_Physical_to_real (void *address, uint16_t *segment, uint16_t *offset) |
Retrieves real mode pointer elements {segmnet, offset} from physical address. More... | |
rtems_raw_irq_hdl | get_hdl_from_vector (rtems_vector_offset) |
int | i386_set_idt_entry (const rtems_raw_irq_connect_data *) |
int | i386_get_current_idt_entry (rtems_raw_irq_connect_data *) |
int | i386_delete_idt_entry (const rtems_raw_irq_connect_data *) |
int | i386_init_idt (rtems_raw_irq_global_settings *config) |
int | i386_get_idt_config (rtems_raw_irq_global_settings **config) |
void | i386_get_info_from_GDTR (segment_descriptors **table, uint16_t *limit) |
void | i386_set_GDTR (segment_descriptors *, uint16_t limit) |
uint32_t | i386_raw_gdt_entry (uint16_t segment_selector_index, segment_descriptors *sd) |
Allows to set a GDT entry. More... | |
void | i386_fill_segment_desc_base (uint32_t base, segment_descriptors *sd) |
fills sd with provided base in appropriate fields of sd More... | |
void | i386_fill_segment_desc_limit (uint32_t limit, segment_descriptors *sd) |
fills sd with provided limit in appropriate fields of sd More... | |
uint32_t | i386_set_gdt_entry (uint16_t segment_selector, uint32_t base, uint32_t limit) |
uint16_t | i386_next_empty_gdt_entry (void) |
Returns next empty descriptor in GDT. More... | |
uint16_t | i386_cpy_gdt_entry (uint16_t segment_selector, segment_descriptors *struct_to_fill) |
Copies GDT entry at index segment_selector to structure pointed to by struct_to_fill . More... | |
segment_descriptors * | i386_get_gdt_entry (uint16_t sgmnt_selector) |
Returns pointer to GDT table at index given by segment_selector . More... | |
RTEMS_INLINE_ROUTINE void * | i386_base_gdt_entry (segment_descriptors *gdt_entry) |
Extracts base address from GDT entry pointed to by gdt_entry . More... | |
uint32_t | i386_limit_gdt_entry (segment_descriptors *gdt_entry) |
Extracts limit in bytes from GDT entry pointed to by gdt_entry . More... | |
Intel I386 CPU Dependent Source.
#define i386_inport_byte | ( | _port, | |
_value | |||
) |
#define i386_inport_long | ( | _port, | |
_value | |||
) |
#define i386_inport_word | ( | _port, | |
_value | |||
) |
#define i386_outport_byte | ( | _port, | |
_value | |||
) |
#define i386_outport_long | ( | _port, | |
_value | |||
) |
#define i386_outport_word | ( | _port, | |
_value | |||
) |
RTEMS_INLINE_ROUTINE void* i386_base_gdt_entry | ( | segment_descriptors * | gdt_entry | ) |
Extracts base address from GDT entry pointed to by gdt_entry
.
[in] | gdt_entry | pointer to entry from which base should be retrieved |
base | address from GDT entry |
uint16_t i386_cpy_gdt_entry | ( | uint16_t | segment_selector, |
segment_descriptors * | struct_to_fill | ||
) |
Copies GDT entry at index segment_selector
to structure pointed to by struct_to_fill
.
[in] | segment_selector | index to GDT table specifying descriptor to copy |
[out] | struct_to_fill | pointer to memory where will be descriptor coppied |
0 | FAILED segment_selector out of GDT range |
<1;65535> | retrieved segment_selector |
void i386_fill_segment_desc_base | ( | uint32_t | base, |
segment_descriptors * | sd | ||
) |
fills sd
with provided base
in appropriate fields of sd
[in] | base | 32-bit address to be set as descriptor's base |
[out] | sd | descriptor being filled with base |
void i386_fill_segment_desc_limit | ( | uint32_t | limit, |
segment_descriptors * | sd | ||
) |
fills sd
with provided limit
in appropriate fields of sd
sets granularity bit if necessary
[in] | limit | 32-bit value representing number of limit bytes |
[out] | sd | descriptor being filled with limit |
segment_descriptors* i386_get_gdt_entry | ( | uint16_t | sgmnt_selector | ) |
Returns pointer to GDT table at index given by segment_selector
.
[in] | sgmnt_selector | index to GDT table for specifying descriptor to get |
NULL | FAILED segment_selector out of GDT range |
pointer | to GDT table at segment_selector |
uint32_t i386_limit_gdt_entry | ( | segment_descriptors * | gdt_entry | ) |
Extracts limit in bytes from GDT entry pointed to by gdt_entry
.
[in] | gdt_entry | pointer to entry from which limit should be retrieved |
limit | value in bytes from GDT entry |
uint16_t i386_next_empty_gdt_entry | ( | void | ) |
Returns next empty descriptor in GDT.
Number of descriptors that can be returned depends on GDT_SIZE
0 | FAILED GDT is full |
<1;65535> | segment_selector number as index to GDT |
int i386_Physical_to_real | ( | void * | address, |
uint16_t * | segment, | ||
uint16_t * | offset | ||
) |
Retrieves real mode pointer elements {segmnet, offset} from physical address.
i386_Physical_to_real Function returns the highest segment (base) address possible. Example: input address - 0x4B3A2 output segment - 0x4B3A offset - 0x2 input address - 0x10F12E output segment - 0xFFFF offset - 0xF13E
[in] | address | address to be converted, must be less than 0x10FFEF |
[out] | segment | segment computed from address |
[out] | offset | offset computed from address |
0 | address not convertible |
1 | segment and offset extracted |
uint32_t i386_raw_gdt_entry | ( | uint16_t | segment_selector_index, |
segment_descriptors * | sd | ||
) |
Allows to set a GDT entry.
Puts global descriptor sd
to the global descriptor table on index segment_selector_index
[in] | segment_selector_index | index to GDT entry |
[in] | sd | structure to be coppied to given segment_selector in GDT |
0 | FAILED out of GDT range or index is 0, which is not valid index in GDT |
1 | SUCCESS |
RTEMS_INLINE_ROUTINE void* i386_Real_to_physical | ( | uint16_t | segment, |
uint16_t | offset | ||
) |
Converts real mode pointer {segment, offset} to physical address.
i386_Real_to_physical
[in] | segment | used with offset to compute physical address |
[in] | offset | used with segment to compute physical address |
physical | address |