From: Lionel Sambuc Date: Fri, 25 Jul 2014 13:54:54 +0000 (+0200) Subject: Message type for SYS_READBIOS. X-Git-Tag: v3.3.0~108 X-Git-Url: http://zhaoyanbai.com/repos/Bv9ARM.ch13.html?a=commitdiff_plain;h=f45c6b86cb6a88f7d1815c8e9fe337ff1c7600ae;p=minix.git Message type for SYS_READBIOS. Change-Id: Id19f658f5eb5f350e3e19f9ce3f8ae80aea23c51 --- diff --git a/include/minix/com.h b/include/minix/com.h index 5e3e79536..f9cb110ed 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -371,11 +371,6 @@ #define PROF_CTL_PTR m7_p1 /* location of info struct */ #define PROF_MEM_PTR m7_p2 /* location of profiling data */ -/* Field names for SYS_READBIOS. */ -#define RDB_SIZE m2_i1 -#define RDB_ADDR m2_l1 -#define RDB_BUF m2_p1 - /* Field names for SYS_VMCTL. */ #define SVMCTL_WHO m1_i1 #define SVMCTL_PARAM m1_i2 /* All SYS_VMCTL requests. */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index a5c2151f7..4f3e87607 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -115,6 +115,15 @@ typedef struct { } mess_11; _ASSERT_MSG_SIZE(mess_11); +typedef struct { + size_t size; + phys_bytes addr; + vir_bytes buf; + + uint8_t padding[44]; +} mess_lsys_krn_readbios; +_ASSERT_MSG_SIZE(mess_lsys_krn_readbios); + typedef struct { off_t offset; void *addr; @@ -1952,6 +1961,7 @@ typedef struct { mess_notify m_notify; mess_sigcalls m_sigcalls; + mess_lsys_krn_readbios m_lsys_krn_readbios; mess_input_tty_event m_input_tty_event; mess_krn_lsys_schedule m_krn_lsys_schedule; diff --git a/kernel/arch/i386/do_readbios.c b/kernel/arch/i386/do_readbios.c index 3f162570f..b7ad3c524 100644 --- a/kernel/arch/i386/do_readbios.c +++ b/kernel/arch/i386/do_readbios.c @@ -2,9 +2,9 @@ * m_type: SYS_READBIOS * * The parameters for this kernel call are: - * m2_i1: RDB_SIZE number of bytes to copy - * m2_l1: RDB_ADDR absolute address in BIOS area - * m2_p1: RDB_BUF buffer address in requesting process + * m_lsys_krn_readbios.size number of bytes to copy + * m_lsys_krn_readbios.addr absolute address in BIOS area + * m_lsys_krn_readbios.buf buffer address in requesting process */ #include "kernel/system.h" @@ -16,10 +16,11 @@ int do_readbios(struct proc * caller, message * m_ptr) { struct vir_addr src, dst; - vir_bytes len = m_ptr->RDB_SIZE, limit; + size_t len = m_ptr->m_lsys_krn_readbios.size; + vir_bytes limit; - src.offset = m_ptr->RDB_ADDR; - dst.offset = (vir_bytes) m_ptr->RDB_BUF; + src.offset = m_ptr->m_lsys_krn_readbios.addr; + dst.offset = m_ptr->m_lsys_krn_readbios.buf; src.proc_nr_e = NONE; dst.proc_nr_e = m_ptr->m_source; @@ -33,5 +34,5 @@ int do_readbios(struct proc * caller, message * m_ptr) !USERRANGE(BASE_MEM_TOP, UPPER_MEM_END)) return EPERM; - return virtual_copy_vmcheck(caller, &src, &dst, m_ptr->RDB_SIZE); + return virtual_copy_vmcheck(caller, &src, &dst, m_ptr->m_lsys_krn_readbios.size); } diff --git a/lib/libsys/arch/i386/sys_readbios.c b/lib/libsys/arch/i386/sys_readbios.c index 3e3f555e8..497f3c4bf 100644 --- a/lib/libsys/arch/i386/sys_readbios.c +++ b/lib/libsys/arch/i386/sys_readbios.c @@ -8,8 +8,8 @@ size_t size; /* Amount of data to read */ /* Read data from BIOS locations */ message m; - m.RDB_SIZE = size; - m.RDB_ADDR = address; - m.RDB_BUF = buf; + m.m_lsys_krn_readbios.size = size; + m.m_lsys_krn_readbios.addr = address; + m.m_lsys_krn_readbios.buf = buf; return(_kernel_call(SYS_READBIOS, &m)); }