summaryrefslogtreecommitdiffstats
path: root/src/arch/x86/interface/syslinux
diff options
context:
space:
mode:
authorMichael Brown2025-04-21 19:28:56 +0200
committerMichael Brown2025-04-21 19:28:56 +0200
commit050df80bbc455efaf8c44ea00d55fd344d96f808 (patch)
tree5d939943025f0f8cf8d3b2392f8d30393a1b77a6 /src/arch/x86/interface/syslinux
parent[uaccess] Remove user_to_phys() and phys_to_user() (diff)
downloadipxe-050df80bbc455efaf8c44ea00d55fd344d96f808.tar.gz
ipxe-050df80bbc455efaf8c44ea00d55fd344d96f808.tar.xz
ipxe-050df80bbc455efaf8c44ea00d55fd344d96f808.zip
[uaccess] Replace real_to_user() with real_to_virt()
Remove the intermediate concept of a user pointer from real address conversion, leaving real_to_virt() as the directly implemented function. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/x86/interface/syslinux')
-rw-r--r--src/arch/x86/interface/syslinux/comboot_call.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/arch/x86/interface/syslinux/comboot_call.c b/src/arch/x86/interface/syslinux/comboot_call.c
index d7e923b70..d8c245757 100644
--- a/src/arch/x86/interface/syslinux/comboot_call.c
+++ b/src/arch/x86/interface/syslinux/comboot_call.c
@@ -90,7 +90,7 @@ static uint16_t comboot_graphics_mode = 0;
static void print_user_string ( unsigned int segment, unsigned int offset, char terminator ) {
int i = 0;
char c;
- userptr_t str = real_to_user ( segment, offset );
+ userptr_t str = real_to_virt ( segment, offset );
for ( ; ; ) {
copy_from_user ( &c, str, i, 1 );
if ( c == terminator ) break;
@@ -109,7 +109,7 @@ static void shuffle ( unsigned int list_segment, unsigned int list_offset, unsig
unsigned int i;
/* Copy shuffle descriptor list so it doesn't get overwritten */
- copy_from_user ( shuf, real_to_user ( list_segment, list_offset ), 0,
+ copy_from_user ( shuf, real_to_virt ( list_segment, list_offset ), 0,
count * sizeof( comboot_shuffle_descriptor ) );
/* Do the copies */
@@ -346,7 +346,7 @@ static __asmcall __used void int22 ( struct i386_all_regs *ix86 ) {
case 0x0003: /* Run command */
{
- userptr_t cmd_u = real_to_user ( ix86->segs.es, ix86->regs.bx );
+ userptr_t cmd_u = real_to_virt ( ix86->segs.es, ix86->regs.bx );
int len = strlen ( cmd_u );
char cmd[len + 1];
copy_from_user ( cmd, cmd_u, 0, len + 1 );
@@ -370,7 +370,7 @@ static __asmcall __used void int22 ( struct i386_all_regs *ix86 ) {
case 0x0006: /* Open file */
{
int fd;
- userptr_t file_u = real_to_user ( ix86->segs.es, ix86->regs.si );
+ userptr_t file_u = real_to_virt ( ix86->segs.es, ix86->regs.si );
int len = strlen ( file_u );
char file[len + 1];
@@ -410,7 +410,7 @@ static __asmcall __used void int22 ( struct i386_all_regs *ix86 ) {
int len = ix86->regs.cx * COMBOOT_FILE_BLOCKSZ;
int rc;
fd_set fds;
- userptr_t buf = real_to_user ( ix86->segs.es, ix86->regs.bx );
+ userptr_t buf = real_to_virt ( ix86->segs.es, ix86->regs.bx );
/* Wait for data ready to read */
FD_ZERO ( &fds );
@@ -483,7 +483,7 @@ static __asmcall __used void int22 ( struct i386_all_regs *ix86 ) {
case 0x0010: /* Resolve hostname */
{
- userptr_t hostname_u = real_to_user ( ix86->segs.es, ix86->regs.bx );
+ userptr_t hostname_u = real_to_virt ( ix86->segs.es, ix86->regs.bx );
int len = strlen ( hostname_u );
char hostname[len];
struct in_addr addr;
@@ -549,8 +549,8 @@ static __asmcall __used void int22 ( struct i386_all_regs *ix86 ) {
case 0x0016: /* Run kernel image */
{
- userptr_t file_u = real_to_user ( ix86->segs.ds, ix86->regs.si );
- userptr_t cmd_u = real_to_user ( ix86->segs.es, ix86->regs.bx );
+ userptr_t file_u = real_to_virt ( ix86->segs.ds, ix86->regs.si );
+ userptr_t cmd_u = real_to_virt ( ix86->segs.es, ix86->regs.bx );
int file_len = strlen ( file_u );
int cmd_len = strlen ( cmd_u );
char file[file_len + 1];
@@ -595,8 +595,8 @@ static __asmcall __used void int22 ( struct i386_all_regs *ix86 ) {
shuffle ( ix86->segs.es, ix86->regs.di, ix86->regs.cx );
/* Copy initial register values to .text16 */
- memcpy ( real_to_user ( rm_cs, (unsigned) __from_text16 ( &comboot_initial_regs ) ),
- real_to_user ( ix86->segs.ds, ix86->regs.si ),
+ memcpy ( real_to_virt ( rm_cs, (unsigned) __from_text16 ( &comboot_initial_regs ) ),
+ real_to_virt ( ix86->segs.ds, ix86->regs.si ),
sizeof(syslinux_rm_regs) );
/* Load initial register values */