Message type for SYS_READBIOS.
Change-Id: Id19f658f5eb5f350e3e19f9ce3f8ae80aea23c51
This commit is contained in:
parent
b51e653dd4
commit
f45c6b86cb
4 changed files with 21 additions and 15 deletions
|
@ -371,11 +371,6 @@
|
||||||
#define PROF_CTL_PTR m7_p1 /* location of info struct */
|
#define PROF_CTL_PTR m7_p1 /* location of info struct */
|
||||||
#define PROF_MEM_PTR m7_p2 /* location of profiling data */
|
#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. */
|
/* Field names for SYS_VMCTL. */
|
||||||
#define SVMCTL_WHO m1_i1
|
#define SVMCTL_WHO m1_i1
|
||||||
#define SVMCTL_PARAM m1_i2 /* All SYS_VMCTL requests. */
|
#define SVMCTL_PARAM m1_i2 /* All SYS_VMCTL requests. */
|
||||||
|
|
|
@ -115,6 +115,15 @@ typedef struct {
|
||||||
} mess_11;
|
} mess_11;
|
||||||
_ASSERT_MSG_SIZE(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 {
|
typedef struct {
|
||||||
off_t offset;
|
off_t offset;
|
||||||
void *addr;
|
void *addr;
|
||||||
|
@ -1952,6 +1961,7 @@ typedef struct {
|
||||||
mess_notify m_notify;
|
mess_notify m_notify;
|
||||||
mess_sigcalls m_sigcalls;
|
mess_sigcalls m_sigcalls;
|
||||||
|
|
||||||
|
mess_lsys_krn_readbios m_lsys_krn_readbios;
|
||||||
mess_input_tty_event m_input_tty_event;
|
mess_input_tty_event m_input_tty_event;
|
||||||
|
|
||||||
mess_krn_lsys_schedule m_krn_lsys_schedule;
|
mess_krn_lsys_schedule m_krn_lsys_schedule;
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
* m_type: SYS_READBIOS
|
* m_type: SYS_READBIOS
|
||||||
*
|
*
|
||||||
* The parameters for this kernel call are:
|
* The parameters for this kernel call are:
|
||||||
* m2_i1: RDB_SIZE number of bytes to copy
|
* m_lsys_krn_readbios.size number of bytes to copy
|
||||||
* m2_l1: RDB_ADDR absolute address in BIOS area
|
* m_lsys_krn_readbios.addr absolute address in BIOS area
|
||||||
* m2_p1: RDB_BUF buffer address in requesting process
|
* m_lsys_krn_readbios.buf buffer address in requesting process
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "kernel/system.h"
|
#include "kernel/system.h"
|
||||||
|
@ -16,10 +16,11 @@
|
||||||
int do_readbios(struct proc * caller, message * m_ptr)
|
int do_readbios(struct proc * caller, message * m_ptr)
|
||||||
{
|
{
|
||||||
struct vir_addr src, dst;
|
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;
|
src.offset = m_ptr->m_lsys_krn_readbios.addr;
|
||||||
dst.offset = (vir_bytes) m_ptr->RDB_BUF;
|
dst.offset = m_ptr->m_lsys_krn_readbios.buf;
|
||||||
src.proc_nr_e = NONE;
|
src.proc_nr_e = NONE;
|
||||||
dst.proc_nr_e = m_ptr->m_source;
|
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))
|
!USERRANGE(BASE_MEM_TOP, UPPER_MEM_END))
|
||||||
return EPERM;
|
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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,8 @@ size_t size; /* Amount of data to read */
|
||||||
/* Read data from BIOS locations */
|
/* Read data from BIOS locations */
|
||||||
message m;
|
message m;
|
||||||
|
|
||||||
m.RDB_SIZE = size;
|
m.m_lsys_krn_readbios.size = size;
|
||||||
m.RDB_ADDR = address;
|
m.m_lsys_krn_readbios.addr = address;
|
||||||
m.RDB_BUF = buf;
|
m.m_lsys_krn_readbios.buf = buf;
|
||||||
return(_kernel_call(SYS_READBIOS, &m));
|
return(_kernel_call(SYS_READBIOS, &m));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue