iPXE
librm.h File Reference

Go to the source code of this file.

Data Structures

struct  idtr32
 A 32-bit interrupt descriptor table register. More...
struct  idtr64
 A 64-bit interrupt descriptor table register. More...
struct  interrupt32_descriptor
 A 32-bit interrupt descriptor table entry. More...
struct  interrupt64_descriptor
 A 64-bit interrupt descriptor table entry. More...
struct  interrupt_vector
 An interrupt vector. More...
struct  interrupt_frame32
 32-bit interrupt wrapper stack frame More...
struct  interrupt_frame64
 64-bit interrupt wrapper stack frame More...
struct  page_table
 A page table. More...

Macros

#define VIRTUAL_CS   0x08
#define VIRTUAL_DS   0x10
#define PHYSICAL_CS   0x18
#define PHYSICAL_DS   0x20
#define REAL_CS   0x28
#define REAL_DS   0x30
#define P2R_DS   0x38
#define LONG_CS   0x40
#define VIRTUAL(address)
#define VIRT_CALL(function)
 Call C function from real-mode code.
#define __data16(variable)
#define __data16_array(variable, array)
#define __bss16(variable)
#define __bss16_array(variable, array)
#define __text16(variable)
#define __text16_array(variable, array)
#define __use_data16(variable)
#define __use_text16(variable)
#define __from_data16(pointer)
#define __from_text16(pointer)
#define rm_cs   __use_text16 ( rm_cs )
#define rm_ds   __use_text16 ( rm_ds )
#define CODE_DEFAULT   ".code32"
#define STACK_DEFAULT   "l"
#define LINE_SYMBOL   _S2 ( OBJECT ) "__line_" _S2 ( __LINE__ ) "__%=:"
#define TEXT16_CODE(asm_code_str)
#define REAL_CODE(asm_code_str)
#define PHYS_CODE(asm_code_str)
#define NUM_INT   256
 Number of interrupts.
#define IDTE_PRESENT   0x80
 Interrupt descriptor is present.
#define IDTE_TYPE_IRQ32   0x0e
 Interrupt descriptor 32-bit interrupt gate type.
#define IDTE_TYPE_IRQ64   0x0e
 Interrupt descriptor 64-bit interrupt gate type.
#define PUSH_INSN   0x50
 "push %eax" instruction
#define MOVB_INSN   0xb0
 "movb" instruction
#define JMP_INSN   0xe9
 "jmp" instruction
#define IO_PAGE_COUNT    ( sizeof ( io_pages.page ) / sizeof ( io_pages.page[0] ) )
 Maximum number of I/O pages.
#define IO_PAGE_SIZE   0x200000UL
 I/O page size.
#define IO_BASE   ( ( void * ) 0x100000000ULL )
 I/O page base address.
#define sipi   __use_text16 ( sipi )
#define sipi_len   ABS_VALUE ( sipi_len )
#define sipi_ds   __use_text16 ( sipi_ds )

Enumerations

enum  page_flags {
  PAGE_P = 0x01 , PAGE_RW = 0x02 , PAGE_US = 0x04 , PAGE_PWT = 0x08 ,
  PAGE_PCD = 0x10 , PAGE_PS = 0x80 , PAGE_LAST = 0x800
}
 Page flags. More...

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
const uint16_t __text16 (rm_cs)
const uint16_t __text16 (rm_ds)
uint16_t copy_to_rm_stack (const void *data, size_t size)
 Allocate space on the real-mode stack and copy data there.
void remove_from_rm_stack (void *data, size_t size)
 Deallocate space on the real-mode stack, optionally copying back data.
struct idtr32 __attribute__ ((packed))
void set_interrupt_vector (unsigned int intr, void *vector)
 Set interrupt vector.
char __text16_array (sipi, [])
 Startup IPI real-mode handler.
size_t ABS_SYMBOL (sipi_len)
 Length of startup IPI real-mode handler.
uint16_t __text16 (sipi_ds)
 Startup IPI real-mode handler copy of real-mode data segment.
void setup_sipi (unsigned int vector, uint32_t handler, struct i386_regs *regs)
 Set up startup IPI handler.

Variables

char *const data16
char *const text16
uint16_t rm_sp
uint16_t rm_ss
uint16_t limit
 Limit.
uint32_t base
 Base.
uint16_t low
 Low 16 bits of address.
uint16_t segment
 Code segment.
uint8_t unused
 Unused.
uint8_t attr
 Type and attributes.
uint16_t high
 High 16 bits of address.
uint16_t mid
 Middle 16 bits of address.
uint32_t reserved
 Reserved.
uint8_t push
 "push" instruction
uint8_t movb
 "movb" instruction
uint8_t intr
 Interrupt number.
uint8_t jmp
 "jmp" instruction
uint32_t offset
 Interrupt wrapper address offset.
uint8_t next [0]
 Next instruction after jump.
uint32_t esp
uint32_t ss
uint32_t gs
uint32_t fs
uint32_t es
uint32_t ds
uint32_t ebp
uint32_t edi
uint32_t esi
uint32_t edx
uint32_t ecx
uint32_t ebx
uint32_t eax
uint32_t eip
uint32_t cs
uint32_t eflags
uint64_t r15
uint64_t r14
uint64_t r13
uint64_t r12
uint64_t r11
uint64_t r10
uint64_t r9
uint64_t r8
uint64_t rbp
uint64_t rdi
uint64_t rsi
uint64_t rdx
uint64_t rcx
uint64_t rbx
uint64_t rax
uint64_t rip
uint64_t rflags
uint64_t rsp
struct page_table __attribute__
struct page_table io_pages
 The I/O space page table.
uint32_t sipi_handler
 Startup IPI protected-mode handler (physical address)
struct i386_regs sipi_regs
 Startup IPI register state.

Macro Definition Documentation

◆ VIRTUAL_CS

#define VIRTUAL_CS   0x08

Definition at line 10 of file librm.h.

Referenced by set_interrupt_vector().

◆ VIRTUAL_DS

#define VIRTUAL_DS   0x10

Definition at line 11 of file librm.h.

◆ PHYSICAL_CS

#define PHYSICAL_CS   0x18

Definition at line 12 of file librm.h.

◆ PHYSICAL_DS

#define PHYSICAL_DS   0x20

Definition at line 13 of file librm.h.

◆ REAL_CS

#define REAL_CS   0x28

Definition at line 14 of file librm.h.

◆ REAL_DS

#define REAL_DS   0x30

Definition at line 15 of file librm.h.

◆ P2R_DS

#define P2R_DS   0x38

Definition at line 16 of file librm.h.

◆ LONG_CS

#define LONG_CS   0x40

Definition at line 17 of file librm.h.

Referenced by set_interrupt_vector().

◆ VIRTUAL

#define VIRTUAL ( address)
Value:
uint64_t address
Base address.
Definition ena.h:13

Definition at line 50 of file librm.h.

◆ VIRT_CALL

#define VIRT_CALL ( function)
Value:
"pushl $( " _S2 ( VIRTUAL ( function ) ) " )\n\t" \
"call virt_call\n\t"
uint8_t function
Function.
Definition edd.h:5
#define _S2(x)
Stringify expanded argument.
Definition compiler.h:53
#define VIRTUAL(address)
Definition librm.h:50

Call C function from real-mode code.

Parameters
functionC function

Definition at line 72 of file librm.h.

72#define VIRT_CALL( function ) \
73 "pushl $( " _S2 ( VIRTUAL ( function ) ) " )\n\t" \
74 "call virt_call\n\t"

Referenced by _dump_regs(), bios_inject_startup(), hook_comboot_interrupts(), int13_hook_vector(), and librm_test_exec().

◆ __data16

#define __data16 ( variable)
Value:
__attribute__ (( section ( ".data16" ) )) \
_data16_ ## variable __asm__ ( #variable )
#define __attribute__(x)
Definition compiler.h:10
struct netvsc_rx_buffer_section section[1]
Section descriptors.
Definition netvsc.h:7
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")

Definition at line 85 of file librm.h.

85#define __data16( variable ) \
86 __attribute__ (( section ( ".data16" ) )) \
87 _data16_ ## variable __asm__ ( #variable )

◆ __data16_array

#define __data16_array ( variable,
array )
Value:
__attribute__ (( section ( ".data16" ) )) \
_data16_ ## variable array __asm__ ( #variable )
uint32_t array
Array number.
Definition edd.h:1

Definition at line 89 of file librm.h.

89#define __data16_array( variable, array ) \
90 __attribute__ (( section ( ".data16" ) )) \
91 _data16_ ## variable array __asm__ ( #variable )

◆ __bss16

#define __bss16 ( variable)
Value:
__attribute__ (( section ( ".bss16" ) )) \
_data16_ ## variable __asm__ ( #variable )

Definition at line 93 of file librm.h.

93#define __bss16( variable ) \
94 __attribute__ (( section ( ".bss16" ) )) \
95 _data16_ ## variable __asm__ ( #variable )

◆ __bss16_array

#define __bss16_array ( variable,
array )
Value:
__attribute__ (( section ( ".bss16" ) )) \
_data16_ ## variable array __asm__ ( #variable )

Definition at line 97 of file librm.h.

97#define __bss16_array( variable, array ) \
98 __attribute__ (( section ( ".bss16" ) )) \
99 _data16_ ## variable array __asm__ ( #variable )

◆ __text16

#define __text16 ( variable)
Value:
__attribute__ (( section ( ".text16.data" ) )) \
_text16_ ## variable __asm__ ( #variable )

Definition at line 101 of file librm.h.

101#define __text16( variable ) \
102 __attribute__ (( section ( ".text16.data" ) )) \
103 _text16_ ## variable __asm__ ( #variable )

◆ __text16_array

#define __text16_array ( variable,
array )
Value:
__attribute__ (( section ( ".text16.data" ) )) \
_text16_ ## variable array __asm__ ( #variable )

Definition at line 105 of file librm.h.

105#define __text16_array( variable, array ) \
106 __attribute__ (( section ( ".text16.data" ) )) \
107 _text16_ ## variable array __asm__ ( #variable )

◆ __use_data16

#define __use_data16 ( variable)
Value:
( * ( ( typeof ( _data16_ ## variable ) * ) \
& ( data16 [ ( size_t ) & ( _data16_ ## variable ) ] ) ) )
typeof(acpi_finder=acpi_find)
ACPI table finder.
Definition acpi.c:48
char *const data16
Definition ib_mad.h:8

Definition at line 109 of file librm.h.

109#define __use_data16( variable ) \
110 ( * ( ( typeof ( _data16_ ## variable ) * ) \
111 & ( data16 [ ( size_t ) & ( _data16_ ## variable ) ] ) ) )

◆ __use_text16

#define __use_text16 ( variable)
Value:
( * ( ( typeof ( _text16_ ## variable ) * ) \
& ( text16 [ ( size_t ) & ( _text16_ ## variable ) ] ) ) )
char *const text16

Definition at line 113 of file librm.h.

113#define __use_text16( variable ) \
114 ( * ( ( typeof ( _text16_ ## variable ) * ) \
115 & ( text16 [ ( size_t ) & ( _text16_ ## variable ) ] ) ) )

◆ __from_data16

#define __from_data16 ( pointer)
Value:
( ( unsigned int ) \
( ( ( void * ) (pointer) ) - ( ( void * ) data16 ) ) )

Definition at line 117 of file librm.h.

117#define __from_data16( pointer ) \
118 ( ( unsigned int ) \
119 ( ( ( void * ) (pointer) ) - ( ( void * ) data16 ) ) )

◆ __from_text16

#define __from_text16 ( pointer)
Value:
( ( unsigned int ) \
( ( ( void * ) (pointer) ) - ( ( void * ) text16 ) ) )

Definition at line 121 of file librm.h.

121#define __from_text16( pointer ) \
122 ( ( unsigned int ) \
123 ( ( ( void * ) (pointer) ) - ( ( void * ) text16 ) ) )

◆ rm_cs

#define rm_cs   __use_text16 ( rm_cs )

Definition at line 129 of file librm.h.

◆ rm_ds

#define rm_ds   __use_text16 ( rm_ds )

Definition at line 131 of file librm.h.

◆ CODE_DEFAULT

#define CODE_DEFAULT   ".code32"

Definition at line 141 of file librm.h.

◆ STACK_DEFAULT

#define STACK_DEFAULT   "l"

Definition at line 142 of file librm.h.

◆ LINE_SYMBOL

#define LINE_SYMBOL   _S2 ( OBJECT ) "__line_" _S2 ( __LINE__ ) "__%=:"

Definition at line 146 of file librm.h.

◆ TEXT16_CODE

#define TEXT16_CODE ( asm_code_str)
Value:
".section \".text16\", \"ax\", @progbits\n\t" \
"\n" LINE_SYMBOL "\n\t" \
".code16\n\t" \
asm_code_str "\n\t" \
CODE_DEFAULT "\n\t" \
".previous\n\t"
#define CODE_DEFAULT
Definition librm.h:141
#define LINE_SYMBOL
Definition librm.h:146

Definition at line 149 of file librm.h.

149#define TEXT16_CODE( asm_code_str ) \
150 ".section \".text16\", \"ax\", @progbits\n\t" \
151 "\n" LINE_SYMBOL "\n\t" \
152 ".code16\n\t" \
153 asm_code_str "\n\t" \
154 CODE_DEFAULT "\n\t" \
155 ".previous\n\t"

◆ REAL_CODE

#define REAL_CODE ( asm_code_str)
Value:
"push" STACK_DEFAULT " $1f\n\t" \
"call real_call\n\t" \
TEXT16_CODE ( "\n1:\n\t" \
asm_code_str \
"\n\t" \
"ret\n\t" )
#define STACK_DEFAULT
Definition librm.h:142

Definition at line 158 of file librm.h.

158#define REAL_CODE( asm_code_str ) \
159 "push" STACK_DEFAULT " $1f\n\t" \
160 "call real_call\n\t" \
161 TEXT16_CODE ( "\n1:\n\t" \
162 asm_code_str \
163 "\n\t" \
164 "ret\n\t" )

◆ PHYS_CODE

#define PHYS_CODE ( asm_code_str)
Value:
"push" STACK_DEFAULT " $1f\n\t" \
"call phys_call\n\t" \
".section \".text.phys\", \"ax\", @progbits\n\t"\
"\n" LINE_SYMBOL "\n\t" \
".code32\n\t" \
"\n1:\n\t" \
asm_code_str \
"\n\t" \
"ret\n\t" \
CODE_DEFAULT "\n\t" \
".previous\n\t"

Definition at line 167 of file librm.h.

167#define PHYS_CODE( asm_code_str ) \
168 "push" STACK_DEFAULT " $1f\n\t" \
169 "call phys_call\n\t" \
170 ".section \".text.phys\", \"ax\", @progbits\n\t"\
171 "\n" LINE_SYMBOL "\n\t" \
172 ".code32\n\t" \
173 "\n1:\n\t" \
174 asm_code_str \
175 "\n\t" \
176 "ret\n\t" \
177 CODE_DEFAULT "\n\t" \
178 ".previous\n\t"

Referenced by bios_mp_exec_boot(), com32_exec_loop(), elfboot_exec(), multiboot_exec(), and nbi_boot32().

◆ NUM_INT

#define NUM_INT   256

Number of interrupts.

Definition at line 181 of file librm.h.

Referenced by init_idt().

◆ IDTE_PRESENT

#define IDTE_PRESENT   0x80

Interrupt descriptor is present.

Definition at line 232 of file librm.h.

Referenced by set_interrupt_vector().

◆ IDTE_TYPE_IRQ32

#define IDTE_TYPE_IRQ32   0x0e

Interrupt descriptor 32-bit interrupt gate type.

Definition at line 235 of file librm.h.

Referenced by set_interrupt_vector().

◆ IDTE_TYPE_IRQ64

#define IDTE_TYPE_IRQ64   0x0e

Interrupt descriptor 64-bit interrupt gate type.

Definition at line 238 of file librm.h.

Referenced by set_interrupt_vector().

◆ PUSH_INSN

#define PUSH_INSN   0x50

"push %eax" instruction

Definition at line 264 of file librm.h.

Referenced by init_idt().

◆ MOVB_INSN

#define MOVB_INSN   0xb0

"movb" instruction

Definition at line 267 of file librm.h.

Referenced by init_idt().

◆ JMP_INSN

#define JMP_INSN   0xe9

"jmp" instruction

Definition at line 270 of file librm.h.

Referenced by init_idt().

◆ IO_PAGE_COUNT

#define IO_PAGE_COUNT    ( sizeof ( io_pages.page ) / sizeof ( io_pages.page[0] ) )

Maximum number of I/O pages.

Definition at line 350 of file librm.h.

350#define IO_PAGE_COUNT \
351 ( sizeof ( io_pages.page ) / sizeof ( io_pages.page[0] ) )

Referenced by ioremap_pages(), and iounmap_pages().

◆ IO_PAGE_SIZE

#define IO_PAGE_SIZE   0x200000UL

I/O page size.

We choose to use 2MB pages for I/O space, to minimise the number of page table entries required.

Definition at line 358 of file librm.h.

Referenced by ioremap_pages(), and iounmap_pages().

◆ IO_BASE

#define IO_BASE   ( ( void * ) 0x100000000ULL )

I/O page base address.

We choose to place I/O space immediately above the identity-mapped 32-bit address space.

Definition at line 365 of file librm.h.

Referenced by ioremap_pages(), and iounmap_pages().

◆ sipi

#define sipi   __use_text16 ( sipi )

Definition at line 369 of file librm.h.

Referenced by __text16_array(), and setup_sipi().

◆ sipi_len

#define sipi_len   ABS_VALUE ( sipi_len )

Definition at line 373 of file librm.h.

Referenced by ABS_SYMBOL(), and setup_sipi().

◆ sipi_ds

#define sipi_ds   __use_text16 ( sipi_ds )

Definition at line 377 of file librm.h.

Referenced by __text16(), and setup_sipi().

Enumeration Type Documentation

◆ page_flags

enum page_flags

Page flags.

Enumerator
PAGE_P 

Page is present.

PAGE_RW 

Page is writable.

PAGE_US 

Page is accessible by user code.

PAGE_PWT 

Page-level write-through.

PAGE_PCD 

Page-level cache disable.

PAGE_PS 

Page is a large page.

PAGE_LAST 

Page is the last page in an allocation.

This bit is ignored by the hardware. We use it to track the size of allocations made by ioremap().

Definition at line 325 of file librm.h.

325 {
326 /** Page is present */
327 PAGE_P = 0x01,
328 /** Page is writable */
329 PAGE_RW = 0x02,
330 /** Page is accessible by user code */
331 PAGE_US = 0x04,
332 /** Page-level write-through */
333 PAGE_PWT = 0x08,
334 /** Page-level cache disable */
335 PAGE_PCD = 0x10,
336 /** Page is a large page */
337 PAGE_PS = 0x80,
338 /** Page is the last page in an allocation
339 *
340 * This bit is ignored by the hardware. We use it to track
341 * the size of allocations made by ioremap().
342 */
343 PAGE_LAST = 0x800,
344};
@ PAGE_RW
Page is writable.
Definition librm.h:329
@ PAGE_PWT
Page-level write-through.
Definition librm.h:333
@ PAGE_US
Page is accessible by user code.
Definition librm.h:331
@ PAGE_LAST
Page is the last page in an allocation.
Definition librm.h:343
@ PAGE_P
Page is present.
Definition librm.h:327
@ PAGE_PCD
Page-level cache disable.
Definition librm.h:335
@ PAGE_PS
Page is a large page.
Definition librm.h:337

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ __text16() [1/3]

const uint16_t __text16 ( rm_cs )
extern

References rm_cs.

◆ __text16() [2/3]

const uint16_t __text16 ( rm_ds )
extern

References rm_ds.

◆ copy_to_rm_stack()

uint16_t copy_to_rm_stack ( const void * data,
size_t size )
extern

Allocate space on the real-mode stack and copy data there.

Parameters
dataStack data
sizeSize of stack data
Return values
spNew value of real-mode stack pointer

Definition at line 67 of file librm_mgmt.c.

67 {
68 void *rm_stack;
69
70 rm_sp -= size;
71 rm_stack = real_to_virt ( rm_ss, rm_sp );
72 memcpy ( rm_stack, data, size );
73 return rm_sp;
74}
uint8_t data[48]
Additional event data.
Definition ena.h:11
uint16_t size
Buffer size.
Definition dwmac.h:3
void * memcpy(void *dest, const void *src, size_t len) __nonnull
uint16_t rm_ss
uint16_t rm_sp
static __always_inline void * real_to_virt(unsigned int segment, unsigned int offset)
Convert segment:offset address to virtual address.
Definition realmode.h:77

References data, memcpy(), real_to_virt(), rm_sp, rm_ss, and size.

Referenced by com32_cfarcall().

◆ remove_from_rm_stack()

void remove_from_rm_stack ( void * data,
size_t size )
extern

Deallocate space on the real-mode stack, optionally copying back data.

Parameters
dataStack data buffer, or NULL
sizeSize of stack data

Definition at line 82 of file librm_mgmt.c.

82 {
83 const void *rm_stack;
84
85 if ( data ) {
86 rm_stack = real_to_virt ( rm_ss, rm_sp );
87 memcpy ( data, rm_stack, size );
88 }
89 rm_sp += size;
90}

References data, memcpy(), real_to_virt(), rm_sp, rm_ss, and size.

Referenced by com32_cfarcall().

◆ set_interrupt_vector()

void set_interrupt_vector ( unsigned int intr,
void * vector )
extern

Set interrupt vector.

Parameters
intrInterrupt number
vectorInterrupt vector, or NULL to disable

Definition at line 98 of file librm_mgmt.c.

98 {
99 struct interrupt32_descriptor *idte32;
100 struct interrupt64_descriptor *idte64;
101 intptr_t addr = ( ( intptr_t ) vector );
102
103 /* Populate 32-bit interrupt descriptor */
104 idte32 = &idt32[intr];
105 idte32->segment = VIRTUAL_CS;
106 idte32->attr = ( vector ? ( IDTE_PRESENT | IDTE_TYPE_IRQ32 ) : 0 );
107 idte32->low = ( addr >> 0 );
108 idte32->high = ( addr >> 16 );
109
110 /* Populate 64-bit interrupt descriptor, if applicable */
111 if ( sizeof ( physaddr_t ) > sizeof ( uint32_t ) ) {
112 idte64 = &idt64[intr];
113 idte64->segment = LONG_CS;
114 idte64->attr = ( vector ?
115 ( IDTE_PRESENT | IDTE_TYPE_IRQ64 ) : 0 );
116 idte64->low = ( addr >> 0 );
117 idte64->mid = ( addr >> 16 );
118 idte64->high = ( ( ( uint64_t ) addr ) >> 32 );
119 }
120}
unsigned long intptr_t
Definition stdint.h:21
unsigned int uint32_t
Definition stdint.h:12
unsigned long physaddr_t
Definition stdint.h:20
unsigned long long uint64_t
Definition stdint.h:13
uint32_t addr
Buffer address.
Definition dwmac.h:9
uint32_t vector
MSI-X vector.
Definition ena.h:9
uint8_t intr
Interrupts enabled.
Definition ena.h:3
#define IDTE_PRESENT
Interrupt descriptor is present.
Definition librm.h:232
#define IDTE_TYPE_IRQ32
Interrupt descriptor 32-bit interrupt gate type.
Definition librm.h:235
#define IDTE_TYPE_IRQ64
Interrupt descriptor 64-bit interrupt gate type.
Definition librm.h:238
#define VIRTUAL_CS
Definition librm.h:10
#define LONG_CS
Definition librm.h:17
static struct interrupt64_descriptor idt64[NUM_INT]
The 64-bit interrupt descriptor table.
Definition librm_mgmt.c:40
static struct interrupt32_descriptor idt32[NUM_INT]
The 32-bit interrupt descriptor table.
Definition librm_mgmt.c:31
A 32-bit interrupt descriptor table entry.
Definition librm.h:200
uint16_t low
Low 16 bits of address.
Definition librm.h:202
uint16_t segment
Code segment.
Definition librm.h:204
uint8_t attr
Type and attributes.
Definition librm.h:208
uint16_t high
High 16 bits of address.
Definition librm.h:210
A 64-bit interrupt descriptor table entry.
Definition librm.h:214
uint8_t attr
Type and attributes.
Definition librm.h:222
uint16_t segment
Code segment.
Definition librm.h:218
uint32_t high
High 32 bits of address.
Definition librm.h:226
uint16_t mid
Middle 16 bits of address.
Definition librm.h:224
uint16_t low
Low 16 bits of address.
Definition librm.h:216

References addr, interrupt32_descriptor::attr, interrupt64_descriptor::attr, interrupt32_descriptor::high, interrupt64_descriptor::high, idt32, idt64, IDTE_PRESENT, IDTE_TYPE_IRQ32, IDTE_TYPE_IRQ64, intr, LONG_CS, interrupt32_descriptor::low, interrupt64_descriptor::low, interrupt64_descriptor::mid, interrupt32_descriptor::segment, interrupt64_descriptor::segment, vector, and VIRTUAL_CS.

Referenced by gdbmach_init(), and init_idt().

◆ __text16_array()

char __text16_array ( sipi )
extern

Startup IPI real-mode handler.

References sipi.

◆ ABS_SYMBOL()

size_t ABS_SYMBOL ( sipi_len )
extern

Length of startup IPI real-mode handler.

References sipi_len.

◆ __text16() [3/3]

uint16_t __text16 ( sipi_ds )
extern

Startup IPI real-mode handler copy of real-mode data segment.

References sipi_ds.

◆ setup_sipi()

void setup_sipi ( unsigned int vector,
uint32_t handler,
struct i386_regs * regs )
extern

Set up startup IPI handler.

Parameters
vectorStartup IPI vector
handlerProtected-mode startup IPI handler physical address
regsInitial register state

Definition at line 417 of file librm_mgmt.c.

418 {
419
420 /* Record protected-mode handler */
421 sipi_handler = handler;
422
423 /* Update copy of rm_ds */
424 sipi_ds = rm_ds;
425
426 /* Save register state */
427 memcpy ( &sipi_regs, regs, sizeof ( sipi_regs ) );
428
429 /* Copy real-mode handler */
430 copy_to_real ( ( vector << 8 ), 0, sipi, sipi_len );
431}
#define rm_ds
Definition libkir.h:39
#define copy_to_real
Definition libkir.h:78
uint32_t sipi_handler
Startup IPI protected-mode handler (physical address)
#define sipi_ds
Definition librm.h:377
#define sipi_len
Definition librm.h:373
#define sipi
Definition librm.h:369
struct i386_regs sipi_regs
Startup IPI register state.
Definition librm_mgmt.c:49
struct i386_regs regs
Definition registers.h:1

References copy_to_real, memcpy(), regs, rm_ds, sipi, sipi_ds, sipi_handler, sipi_len, sipi_regs, and vector.

Referenced by bios_mp_start_all().

Variable Documentation

◆ data16

char* const data16
extern

Definition at line 8 of file ib_mad.h.

◆ text16

char* const text16
extern

◆ rm_sp

uint16_t rm_sp
extern

◆ rm_ss

uint16_t rm_ss
extern

◆ limit

◆ base

◆ low

uint16_t low

Low 16 bits of address.

Definition at line 1 of file librm.h.

◆ segment

◆ unused

◆ attr

◆ high

uint32_t high

High 16 bits of address.

High 32 bits of address.

Definition at line 9 of file librm.h.

◆ mid

uint16_t mid

Middle 16 bits of address.

Definition at line 9 of file librm.h.

Referenced by peerblk_raw_rx(), and prep_segment().

◆ reserved

uint32_t reserved

Reserved.

Definition at line 13 of file librm.h.

◆ push

uint8_t push

"push" instruction

Definition at line 1 of file librm.h.

◆ movb

uint8_t movb

"movb" instruction

Definition at line 3 of file librm.h.

◆ intr

uint8_t intr

Interrupt number.

Definition at line 5 of file librm.h.

◆ jmp

uint8_t jmp

"jmp" instruction

Definition at line 7 of file librm.h.

Referenced by pxe_start_nbp().

◆ offset

uint32_t offset

Interrupt wrapper address offset.

Definition at line 9 of file librm.h.

◆ next

uint8_t next[0]

Next instruction after jump.

Definition at line 11 of file librm.h.

◆ esp

uint32_t esp

Definition at line 0 of file librm.h.

Referenced by interrupt_dump().

◆ ss

Definition at line 1 of file librm.h.

Referenced by ath9k_hw_get_gain_boundaries_pdadcs(), and memsetw().

◆ gs

Definition at line 2 of file librm.h.

◆ fs

Definition at line 3 of file librm.h.

Referenced by efi_block_root(), and efi_local_open_root().

◆ es

Definition at line 4 of file librm.h.

Referenced by REQUIRE_KEYMAP().

◆ ds

◆ ebp

uint32_t ebp

Definition at line 6 of file librm.h.

◆ edi

uint32_t edi

Definition at line 7 of file librm.h.

◆ esi

uint32_t esi

Definition at line 8 of file librm.h.

◆ edx

uint32_t edx

Definition at line 9 of file librm.h.

◆ ecx

uint32_t ecx

Definition at line 10 of file librm.h.

◆ ebx

uint32_t ebx

Definition at line 11 of file librm.h.

◆ eax

uint32_t eax

Definition at line 12 of file librm.h.

◆ eip

uint32_t eip

Definition at line 13 of file librm.h.

◆ cs

Definition at line 14 of file librm.h.

Referenced by __attribute__(), linda_ib_epb_mod_reg(), and strpbrk().

◆ eflags

uint32_t eflags

Definition at line 15 of file librm.h.

◆ r15

uint64_t r15

Definition at line 0 of file librm.h.

◆ r14

uint64_t r14

Definition at line 1 of file librm.h.

◆ r13

uint64_t r13

Definition at line 2 of file librm.h.

◆ r12

uint64_t r12

Definition at line 3 of file librm.h.

◆ r11

uint64_t r11

Definition at line 4 of file librm.h.

◆ r10

uint64_t r10

Definition at line 5 of file librm.h.

◆ r9

Definition at line 6 of file librm.h.

◆ r8

Definition at line 7 of file librm.h.

◆ rbp

uint64_t rbp

Definition at line 8 of file librm.h.

◆ rdi

uint64_t rdi

Definition at line 9 of file librm.h.

◆ rsi

uint64_t rsi

Definition at line 10 of file librm.h.

◆ rdx

uint64_t rdx

Definition at line 11 of file librm.h.

◆ rcx

uint64_t rcx

Definition at line 12 of file librm.h.

◆ rbx

uint64_t rbx

Definition at line 13 of file librm.h.

◆ rax

uint64_t rax

Definition at line 14 of file librm.h.

◆ rip

uint64_t rip

Definition at line 15 of file librm.h.

◆ rflags

uint64_t rflags

Definition at line 17 of file librm.h.

◆ rsp

◆ io_pages

struct page_table io_pages
extern

The I/O space page table.

Referenced by ioremap_pages(), and iounmap_pages().

◆ sipi_handler

uint32_t sipi_handler
extern

Startup IPI protected-mode handler (physical address)

Referenced by setup_sipi().

◆ sipi_regs

struct i386_regs sipi_regs
extern

Startup IPI register state.

Definition at line 49 of file librm_mgmt.c.

Referenced by setup_sipi().