XenevaOS
Loading...
Searching...
No Matches
Macros | Functions
fixup.c File Reference
#include <fixup.h>
#include <Drivers/uart.h>
Include dependency graph for fixup.c:

Macros

#define USER_LD(dstreg, uptr, faillabel)
 
#define USER_ST(srcreg, uptr, faillabel)
 
#define USER_MAX   0x0001000000000000
 

Functions

 __attribute__ ((section(".rdata$exA")))
 
 __attribute__ ((section(".rdata$exZ")))
 
uint64_t __search_fixup_table (uint64_t fault_pc)
 __search_fixup_table – searches alternative address to jump when kernel hits data abort exception
 
bool _validate_upointer_range (const void *p, size_t n)
 
long __bordoisila_copy_from_user (void *dst, const void *usrc, size_t n)
 __bordoisila_copy_from_user – copy data from user to kernel memory
 
long __bordoisila_copy_to_user (void *udst, const void *src, size_t n)
 __bordoisila_copy_to_user – copy to user memory from kernel memory
 
void __bordoisila_fixup_table_check ()
 __bordoisila_fixup_table_check – could be called during kernel initialization to check fixup addresses
 

Macro Definition Documentation

◆ USER_LD

#define USER_LD (   dstreg,
  uptr,
  faillabel 
)
Value:
__asm__ volatile goto("1: ldtrb %w0, [%1]\n" \
" .pushsection .rdata$exM,\"a\"\n" \
".align 3\n" \
".quad 1b, %l[" #faillabel "]\n" \
" .popsection\n" \
: "=&r"(dstreg) \
: "r"(uptr) \
: "memory" \
: faillabel)

◆ USER_MAX

#define USER_MAX   0x0001000000000000

◆ USER_ST

#define USER_ST (   srcreg,
  uptr,
  faillabel 
)
Value:
__asm__ volatile goto("1: sttrb %w0, [%1]\n" \
".pushsection .rdata$exM,\"a\"\n" \
".align 3\n" \
".quad 1b, %l[" #faillabel "]\n" \
".popsection\n" ::"r"(srcreg), \
"r"(uptr) \
: "memory" \
: faillabel)

Function Documentation

◆ __attribute__() [1/2]

__attribute__ ( (section(".rdata$exA"))  )

◆ __attribute__() [2/2]

__attribute__ ( (section(".rdata$exZ"))  )

◆ __bordoisila_copy_from_user()

long __bordoisila_copy_from_user ( void *  dst,
const void *  usrc,
size_t  n 
)

__bordoisila_copy_from_user – copy data from user to kernel memory

Parameters
dst– destination kernel memory
usrc– user source memory
n– number of bytes to copy

◆ __bordoisila_copy_to_user()

long __bordoisila_copy_to_user ( void *  udst,
const void *  src,
size_t  n 
)

__bordoisila_copy_to_user – copy to user memory from kernel memory

Parameters
udst– user space destination memory
src– kernel source memory
n– number of bytes to copy

◆ __bordoisila_fixup_table_check()

void __bordoisila_fixup_table_check ( )

__bordoisila_fixup_table_check – could be called during kernel initialization to check fixup addresses

◆ __search_fixup_table()

uint64_t __search_fixup_table ( uint64_t  fault_pc)

__search_fixup_table – searches alternative address to jump when kernel hits data abort exception

Parameters
fault_pc– faulting instruction pointer

◆ _validate_upointer_range()

bool _validate_upointer_range ( const void *  p,
size_t  n 
)