iPXE
Data Structures | Macros | Enumerations | Functions | Variables
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)   (address)
 
#define VIRT_CALL(function)
 Call C function from real-mode code. More...
 
#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. More...
 
#define IDTE_PRESENT   0x80
 Interrupt descriptor is present. More...
 
#define IDTE_TYPE_IRQ32   0x0e
 Interrupt descriptor 32-bit interrupt gate type. More...
 
#define IDTE_TYPE_IRQ64   0x0e
 Interrupt descriptor 64-bit interrupt gate type. More...
 
#define PUSH_INSN   0x50
 "push %eax" instruction More...
 
#define MOVB_INSN   0xb0
 "movb" instruction More...
 
#define JMP_INSN   0xe9
 "jmp" instruction More...
 
#define IO_PAGE_COUNT   ( sizeof ( io_pages.page ) / sizeof ( io_pages.page[0] ) )
 Maximum number of I/O pages. More...
 
#define IO_PAGE_SIZE   0x200000UL
 I/O page size. More...
 
#define IO_BASE   ( ( void * ) 0x100000000ULL )
 I/O page base address. More...
 
#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. More...
 
void remove_from_rm_stack (void *data, size_t size)
 Deallocate space on the real-mode stack, optionally copying back data. More...
 
struct idtr32 __attribute__ ((packed))
 
void set_interrupt_vector (unsigned int intr, void *vector)
 Set interrupt vector. More...
 
char __text16_array (sipi, [])
 Startup IPI real-mode handler. More...
 
size_t ABS_SYMBOL (sipi_len)
 Length of startup IPI real-mode handler. More...
 
uint16_t __text16 (sipi_ds)
 Startup IPI real-mode handler copy of real-mode data segment. More...
 
void setup_sipi (unsigned int vector, uint32_t handler, struct i386_regs *regs)
 Set up startup IPI handler. More...
 

Variables

char *const data16
 
char *const text16
 
uint16_t rm_sp
 
uint16_t rm_ss
 
uint16_t limit
 Limit. More...
 
uint32_t base
 Base. More...
 
uint16_t low
 Low 16 bits of address. More...
 
uint16_t segment
 Code segment. More...
 
uint8_t unused
 Unused. More...
 
uint8_t attr
 Type and attributes. More...
 
uint16_t high
 High 16 bits of address. More...
 
uint16_t mid
 Middle 16 bits of address. More...
 
uint32_t reserved
 Reserved. More...
 
uint8_t push
 "push" instruction More...
 
uint8_t movb
 "movb" instruction More...
 
uint8_t intr
 Interrupt number. More...
 
uint8_t jmp
 "jmp" instruction More...
 
uint32_t offset
 Interrupt wrapper address offset. More...
 
uint8_t next [0]
 Next instruction after jump. More...
 
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. More...
 
uint32_t sipi_handler
 Startup IPI protected-mode handler (physical address) More...
 
struct i386_regs sipi_regs
 Startup IPI register state. More...
 

Macro Definition Documentation

◆ VIRTUAL_CS

#define VIRTUAL_CS   0x08

Definition at line 10 of file librm.h.

◆ 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.

◆ VIRTUAL

#define VIRTUAL (   address)    (address)

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"
#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.

◆ __data16

#define __data16 (   variable)
Value:
__attribute__ (( section ( ".data16" ) )) \
_data16_ ## variable __asm__ ( #variable )
struct netvsc_rx_buffer_section section[1]
Section descriptors.
Definition: netvsc.h:18
struct page_table __attribute__
__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.

◆ __data16_array

#define __data16_array (   variable,
  array 
)
Value:
__attribute__ (( section ( ".data16" ) )) \
_data16_ ## variable array __asm__ ( #variable )
struct netvsc_rx_buffer_section section[1]
Section descriptors.
Definition: netvsc.h:18
uint32_t array
Array number.
Definition: edd.h:30
struct page_table __attribute__
__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 89 of file librm.h.

◆ __bss16

#define __bss16 (   variable)
Value:
__attribute__ (( section ( ".bss16" ) )) \
_data16_ ## variable __asm__ ( #variable )
struct netvsc_rx_buffer_section section[1]
Section descriptors.
Definition: netvsc.h:18
struct page_table __attribute__
__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 93 of file librm.h.

◆ __bss16_array

#define __bss16_array (   variable,
  array 
)
Value:
__attribute__ (( section ( ".bss16" ) )) \
_data16_ ## variable array __asm__ ( #variable )
struct netvsc_rx_buffer_section section[1]
Section descriptors.
Definition: netvsc.h:18
uint32_t array
Array number.
Definition: edd.h:30
struct page_table __attribute__
__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 97 of file librm.h.

◆ __text16

#define __text16 (   variable)
Value:
__attribute__ (( section ( ".text16.data" ) )) \
_text16_ ## variable __asm__ ( #variable )
struct netvsc_rx_buffer_section section[1]
Section descriptors.
Definition: netvsc.h:18
struct page_table __attribute__
__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 101 of file librm.h.

◆ __text16_array

#define __text16_array (   variable,
  array 
)
Value:
__attribute__ (( section ( ".text16.data" ) )) \
_text16_ ## variable array __asm__ ( #variable )
struct netvsc_rx_buffer_section section[1]
Section descriptors.
Definition: netvsc.h:18
uint32_t array
Array number.
Definition: edd.h:30
struct page_table __attribute__
__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 105 of file librm.h.

◆ __use_data16

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

Definition at line 109 of file librm.h.

◆ __use_text16

#define __use_text16 (   variable)
Value:
( * ( ( typeof ( _text16_ ## variable ) * ) \
& ( text16 [ ( size_t ) & ( _text16_ ## variable ) ] ) ) )
char *const text16
typeof(acpi_finder=acpi_find)
ACPI table finder.
Definition: acpi.c:47

Definition at line 113 of file librm.h.

◆ __from_data16

#define __from_data16 (   pointer)
Value:
( ( unsigned int ) \
( ( ( void * ) (pointer) ) - ( ( void * ) data16 ) ) )
char *const data16
Definition: ib_mad.h:19

Definition at line 117 of file librm.h.

◆ __from_text16

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

Definition at line 121 of file librm.h.

◆ 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 LINE_SYMBOL
Definition: librm.h:146

Definition at line 149 of file librm.h.

◆ 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.

◆ 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"
#define STACK_DEFAULT
Definition: librm.h:142
#define LINE_SYMBOL
Definition: librm.h:146

Definition at line 167 of file librm.h.

◆ NUM_INT

#define NUM_INT   256

Number of interrupts.

Definition at line 181 of file librm.h.

◆ IDTE_PRESENT

#define IDTE_PRESENT   0x80

Interrupt descriptor is present.

Definition at line 232 of file librm.h.

◆ IDTE_TYPE_IRQ32

#define IDTE_TYPE_IRQ32   0x0e

Interrupt descriptor 32-bit interrupt gate type.

Definition at line 235 of file librm.h.

◆ IDTE_TYPE_IRQ64

#define IDTE_TYPE_IRQ64   0x0e

Interrupt descriptor 64-bit interrupt gate type.

Definition at line 238 of file librm.h.

◆ PUSH_INSN

#define PUSH_INSN   0x50

"push %eax" instruction

Definition at line 264 of file librm.h.

◆ MOVB_INSN

#define MOVB_INSN   0xb0

"movb" instruction

Definition at line 267 of file librm.h.

◆ JMP_INSN

#define JMP_INSN   0xe9

"jmp" instruction

Definition at line 270 of file librm.h.

◆ 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.

◆ 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.

◆ 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.

◆ sipi

#define sipi   __use_text16 ( sipi )

Definition at line 369 of file librm.h.

◆ sipi_len

#define sipi_len   ABS_VALUE ( sipi_len )

Definition at line 373 of file librm.h.

◆ sipi_ds

#define sipi_ds   __use_text16 ( sipi_ds )

Definition at line 377 of file librm.h.

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-level write-through.
Definition: librm.h:333
Page-level cache disable.
Definition: librm.h:335
Page is the last page in an allocation.
Definition: librm.h:343
Page is a large page.
Definition: librm.h:337
Page is writable.
Definition: librm.h:329
Page is accessible by user code.
Definition: librm.h:331
Page is present.
Definition: librm.h:327

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ __text16() [1/3]

const uint16_t __text16 ( rm_cs  )

◆ __text16() [2/3]

const uint16_t __text16 ( rm_ds  )

◆ copy_to_rm_stack()

uint16_t copy_to_rm_stack ( const void *  data,
size_t  size 
)

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 }
uint16_t size
Buffer size.
Definition: dwmac.h:14
static __always_inline void * real_to_virt(unsigned int segment, unsigned int offset)
Convert segment:offset address to virtual address.
Definition: realmode.h:77
void * memcpy(void *dest, const void *src, size_t len) __nonnull
uint16_t rm_ss
uint8_t data[48]
Additional event data.
Definition: ena.h:22
uint16_t rm_sp

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 
)

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 }
uint16_t size
Buffer size.
Definition: dwmac.h:14
static __always_inline void * real_to_virt(unsigned int segment, unsigned int offset)
Convert segment:offset address to virtual address.
Definition: realmode.h:77
void * memcpy(void *dest, const void *src, size_t len) __nonnull
uint16_t rm_ss
uint8_t data[48]
Additional event data.
Definition: ena.h:22
uint16_t rm_sp

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

Referenced by com32_cfarcall().

◆ __attribute__()

struct idtr32 __attribute__ ( (packed)  )

◆ set_interrupt_vector()

void set_interrupt_vector ( unsigned int  intr,
void *  vector 
)

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 }
uint16_t mid
Middle 16 bits of address.
Definition: librm.h:224
uint32_t vector
MSI-X vector.
Definition: ena.h:20
#define IDTE_TYPE_IRQ32
Interrupt descriptor 32-bit interrupt gate type.
Definition: librm.h:235
uint16_t high
High 16 bits of address.
Definition: librm.h:210
#define LONG_CS
Definition: librm.h:17
uint8_t attr
Type and attributes.
Definition: librm.h:208
unsigned long long uint64_t
Definition: stdint.h:13
unsigned long intptr_t
Definition: stdint.h:21
uint32_t high
High 32 bits of address.
Definition: librm.h:226
#define IDTE_TYPE_IRQ64
Interrupt descriptor 64-bit interrupt gate type.
Definition: librm.h:238
A 32-bit interrupt descriptor table entry.
Definition: librm.h:200
uint8_t intr
Interrupts enabled.
Definition: ena.h:14
uint16_t low
Low 16 bits of address.
Definition: librm.h:202
uint32_t addr
Buffer address.
Definition: dwmac.h:20
#define VIRTUAL_CS
Definition: librm.h:10
uint16_t low
Low 16 bits of address.
Definition: librm.h:216
unsigned int uint32_t
Definition: stdint.h:12
A 64-bit interrupt descriptor table entry.
Definition: librm.h:214
unsigned long physaddr_t
Definition: stdint.h:20
#define IDTE_PRESENT
Interrupt descriptor is present.
Definition: librm.h:232
uint16_t segment
Code segment.
Definition: librm.h:218
static struct interrupt64_descriptor idt64[NUM_INT]
The 64-bit interrupt descriptor table.
Definition: librm_mgmt.c:40
uint8_t attr
Type and attributes.
Definition: librm.h:222
uint16_t segment
Code segment.
Definition: librm.h:204
static struct interrupt32_descriptor idt32[NUM_INT]
The 32-bit interrupt descriptor table.
Definition: librm_mgmt.c:31

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  )

Startup IPI real-mode handler.

◆ ABS_SYMBOL()

size_t ABS_SYMBOL ( sipi_len  )

Length of startup IPI real-mode handler.

◆ __text16() [3/3]

uint16_t __text16 ( sipi_ds  )

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

◆ setup_sipi()

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

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 }
uint32_t vector
MSI-X vector.
Definition: ena.h:20
uint32_t sipi_handler
Startup IPI protected-mode handler (physical address)
struct i386_regs sipi_regs
Startup IPI register state.
Definition: librm_mgmt.c:49
#define sipi_ds
Definition: librm.h:377
#define sipi_len
Definition: librm.h:373
#define rm_ds
Definition: libkir.h:39
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define copy_to_real
Definition: libkir.h:78
struct i386_regs regs
Definition: registers.h:15
#define sipi
Definition: librm.h:369

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

Definition at line 19 of file ib_mad.h.

◆ text16

char* const text16

◆ rm_sp

uint16_t rm_sp

◆ rm_ss

uint16_t rm_ss

◆ limit

uint16_t limit

◆ base

uint16_t base

◆ low

uint16_t low

Low 16 bits of address.

Definition at line 136 of file librm.h.

◆ segment

uint16_t segment

◆ unused

uint8_t unused

Unused.

Definition at line 140 of file librm.h.

Referenced by asn1_enter_bits(), find_dhcp_option_with_encap(), and x509_parse_key_usage().

◆ attr

uint8_t attr

◆ high

uint32_t high

High 16 bits of address.

High 32 bits of address.

Definition at line 144 of file librm.h.

◆ mid

uint16_t mid

Middle 16 bits of address.

Definition at line 144 of file librm.h.

Referenced by peerblk_raw_rx(), and prep_segment().

◆ reserved

uint32_t reserved

Reserved.

Definition at line 148 of file librm.h.

◆ push

uint8_t push

"push" instruction

Definition at line 136 of file librm.h.

◆ movb

uint8_t movb

"movb" instruction

Definition at line 138 of file librm.h.

◆ intr

uint8_t intr

Interrupt number.

Definition at line 140 of file librm.h.

◆ jmp

uint8_t jmp

"jmp" instruction

Definition at line 142 of file librm.h.

Referenced by pxe_start_nbp().

◆ offset

uint32_t offset

Interrupt wrapper address offset.

Definition at line 144 of file librm.h.

◆ next

uint8_t next[0]

Next instruction after jump.

Definition at line 146 of file librm.h.

◆ esp

uint32_t esp

Definition at line 135 of file librm.h.

Referenced by interrupt_dump().

◆ ss

Definition at line 136 of file librm.h.

Referenced by ath9k_hw_get_gain_boundaries_pdadcs(), and memsetw().

◆ gs

Definition at line 137 of file librm.h.

◆ fs

Definition at line 138 of file librm.h.

Referenced by efi_block_root(), and efi_local_open_root().

◆ es

Definition at line 139 of file librm.h.

◆ ds

◆ ebp

uint32_t ebp

Definition at line 141 of file librm.h.

◆ edi

uint32_t edi

Definition at line 142 of file librm.h.

◆ esi

uint32_t esi

Definition at line 143 of file librm.h.

◆ edx

uint32_t edx

Definition at line 144 of file librm.h.

◆ ecx

uint32_t ecx

Definition at line 145 of file librm.h.

◆ ebx

uint32_t ebx

Definition at line 146 of file librm.h.

◆ eax

uint32_t eax

Definition at line 147 of file librm.h.

◆ eip

uint32_t eip

Definition at line 148 of file librm.h.

◆ cs

Definition at line 149 of file librm.h.

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

◆ eflags

uint32_t eflags

Definition at line 150 of file librm.h.

◆ r15

uint64_t r15

Definition at line 135 of file librm.h.

◆ r14

uint64_t r14

Definition at line 136 of file librm.h.

◆ r13

uint64_t r13

Definition at line 137 of file librm.h.

◆ r12

uint64_t r12

Definition at line 138 of file librm.h.

◆ r11

uint64_t r11

Definition at line 139 of file librm.h.

◆ r10

uint64_t r10

Definition at line 140 of file librm.h.

◆ r9

Definition at line 141 of file librm.h.

◆ r8

Definition at line 142 of file librm.h.

◆ rbp

uint64_t rbp

Definition at line 143 of file librm.h.

◆ rdi

uint64_t rdi

Definition at line 144 of file librm.h.

◆ rsi

uint64_t rsi

Definition at line 145 of file librm.h.

◆ rdx

uint64_t rdx

Definition at line 146 of file librm.h.

◆ rcx

uint64_t rcx

Definition at line 147 of file librm.h.

◆ rbx

uint64_t rbx

Definition at line 148 of file librm.h.

◆ rax

uint64_t rax

Definition at line 149 of file librm.h.

◆ rip

uint64_t rip

Definition at line 150 of file librm.h.

◆ rflags

uint64_t rflags

Definition at line 152 of file librm.h.

◆ rsp

uint64_t rsp

◆ __attribute__

◆ io_pages

struct page_table io_pages

The I/O space page table.

Referenced by ioremap_pages(), and iounmap_pages().

◆ sipi_handler

uint32_t sipi_handler

Startup IPI protected-mode handler (physical address)

Referenced by setup_sipi().

◆ sipi_regs

struct i386_regs sipi_regs

Startup IPI register state.

Definition at line 49 of file librm_mgmt.c.

Referenced by setup_sipi().