#define OVERFLOW_VECTOR 4 /* from INTO */
/* Fixed system call vector. */
-#define SYS_VECTOR 32 /* system calls are made with int SYSVEC */
-#define SYS386_VECTOR 33 /* except 386 system calls use this */
+#define KERN_CALL_VECTOR 32 /* system calls are made with int SYSVEC */
+#define IPC_VECTOR 33 /* interrupt vector for ipc */
#define LEVEL0_VECTOR 34 /* for execution of a function at level 0 */
/* Suitable irq bases for hardware interrupts. Reprogram the 8259(s) from
_PROTOTYPE( int sendnb, (endpoint_t dest, message *m_ptr) );
_PROTOTYPE( int senda, (asynmsg_t *table, size_t count) );
+_PROTOTYPE( int _do_kernel_call, (message *m_ptr) );
+
#endif /* _IPC_H */
* Minix system library. *
*==========================================================================*/
_PROTOTYPE( int _taskcall, (endpoint_t who, int syscallnr, message *msgptr));
+_PROTOTYPE( int _kernel_call, (int syscallnr, message *msgptr));
_PROTOTYPE( int sys_abort, (int how, ...));
_PROTOTYPE( int sys_enable_iop, (endpoint_t proc_ep));
};
PRIVATE struct gate_table_s gate_table_common[] = {
- { ipc_entry, SYS386_VECTOR, USER_PRIVILEGE },
+ { ipc_entry, IPC_VECTOR, USER_PRIVILEGE },
+ { kernel_call_entry, KERN_CALL_VECTOR, USER_PRIVILEGE },
{ level0_call, LEVEL0_VECTOR, TASK_PRIVILEGE },
{ NULL, 0, 0}
};
PUBLIC int do_int86(struct proc * caller, message * m_ptr)
{
data_copy(caller->p_endpoint, (vir_bytes) m_ptr->INT86_REG86,
- SYSTEM, (vir_bytes) ®86, sizeof(reg86));
+ KERNEL, (vir_bytes) ®86, sizeof(reg86));
level0(int86);
/* Copy results back to the caller */
- data_copy(SYSTEM, (vir_bytes) ®86,
+ data_copy(KERNEL, (vir_bytes) ®86,
caller->p_endpoint, (vir_bytes) m_ptr->INT86_REG86, sizeof(reg86));
/* The BIOS call eats interrupts. Call get_randomness to generate some
#define PRCOPY(pr, pv, v, n) \
(iskernel ? (memcpy((char *) v, (char *) pv, n), OK) : \
- data_copy(pr->p_endpoint, pv, SYSTEM, (vir_bytes) (v), n))
+ data_copy(pr->p_endpoint, pv, KERNEL, (vir_bytes) (v), n))
if(PRCOPY(whichproc, v_bp, &v_hbp, sizeof(v_hbp)) != OK) {
kprintf("(v_bp 0x%lx ?)", v_bp);
hwint_slave(15)
/*
- * syscall is only from a process to kernel
+ * IPC is only from a process to kernel
*/
.balign 16
.globl ipc_entry
jmp restart
+/*
+ * kernel call is only from a process to kernel
+ */
+.balign 16
+.globl kernel_call_entry
+kernel_call_entry:
+
+ SAVE_PROCESS_CTX(0)
+
+ /* save the pointer to the current process */
+ push %ebp
+
+ /* for stack trace */
+ movl $0, %ebp
+
+ /*
+ * pass the syscall arguments from userspace to the handler.
+ * SAVE_PROCESS_CTX() does not clobber these registers, they are still
+ * set as the userspace have set them
+ */
+ push %eax
+
+ call kernel_call
+
+ /* restore the current process pointer and save the return value */
+ add $8, %esp
+
+ jmp restart
+
+
.balign 16
/*
* called by the exception interrupt vectors. If the exception does not push
{ alignment_check, ALIGNMENT_CHECK_VECTOR, INTR_PRIVILEGE },
{ machine_check, MACHINE_CHECK_VECTOR, INTR_PRIVILEGE },
{ simd_exception, SIMD_EXCEPTION_VECTOR, INTR_PRIVILEGE },
- { ipc_entry, SYS386_VECTOR, USER_PRIVILEGE },/* 386 system call */
+ { ipc_entry, IPC_VECTOR, USER_PRIVILEGE },
+ { kernel_call_entry, KERN_CALL_VECTOR, USER_PRIVILEGE },
{ level0_call, LEVEL0_VECTOR, TASK_PRIVILEGE },
{ NULL, 0, 0}
};
#define unset_sys_bit(map,bit) \
( MAP_CHUNK(map.chunk,bit) &= ~(1 << CHUNK_OFFSET(bit) )
-#define reallock do { int d; d = intr_disabled(); intr_disable(); locklevel++; if(d && locklevel == 1) { minix_panic("reallock while interrupts disabled first time", __LINE__); } } while(0)
+#define reallock
-#define realunlock do { if(!intr_disabled()) { minix_panic("realunlock while interrupts enabled", __LINE__); } if(locklevel < 1) { minix_panic("realunlock while locklevel below 1", __LINE__); } locklevel--; if(locklevel == 0) { intr_enable(); } } while(0)
+#define realunlock
/* Disable/ enable hardware interrupts. The parameters of lock() and unlock()
* are used when debugging is enabled. See debug.h for more information.
FLAG(MF_ASYNMSG);
FLAG(MF_FULLVM);
FLAG(MF_DELIVERMSG);
+ FLAG(MF_KCALL_RESUME);
return str;
}
/* Process scheduling information and the kernel reentry count. */
EXTERN struct proc *proc_ptr; /* pointer to currently running process */
EXTERN struct proc *bill_ptr; /* process to bill for clock ticks */
-EXTERN struct proc *vmrestart; /* first process on vmrestart queue */
EXTERN struct proc *vmrequest; /* first process on vmrequest queue */
EXTERN struct proc *pagefaults; /* first process on pagefault queue */
EXTERN unsigned lost_ticks; /* clock ticks counted outside clock task */
if (rp->p_nr == HARDWARE) RTS_SET(rp, RTS_PROC_STOP);
/* IDLE task is never put on a run queue as it is never ready to run */
if (rp->p_nr == IDLE) RTS_SET(rp, RTS_PROC_STOP);
+ /* SYSTEM does not run anymore */
+ if (rp->p_nr == SYSTEM) RTS_SET(rp, RTS_PROC_STOP);
RTS_UNSET(rp, RTS_SLOT_FREE); /* remove RTS_SLOT_FREE and schedule */
alloc_segments(rp);
}
vmassert(proc_ptr);
vmassert(proc_is_runnable(proc_ptr));
while (proc_ptr->p_misc_flags &
- (MF_DELIVERMSG | MF_SC_DEFER | MF_SC_TRACE | MF_SC_ACTIVE)) {
+ (MF_KCALL_RESUME | MF_DELIVERMSG |
+ MF_SC_DEFER | MF_SC_TRACE | MF_SC_ACTIVE)) {
vmassert(proc_is_runnable(proc_ptr));
- if (proc_ptr->p_misc_flags & MF_DELIVERMSG) {
+ if (proc_ptr->p_misc_flags & MF_KCALL_RESUME) {
+ kernel_call_resume(proc_ptr);
+ }
+ else if (proc_ptr->p_misc_flags & MF_DELIVERMSG) {
TRACE(VF_SCHEDULING, printf("delivering to %s / %d\n",
proc_ptr->p_name, proc_ptr->p_endpoint););
if(delivermsg(proc_ptr) == VMSUSPEND) {
#define A_RETRIEVE(entry, field) \
if(data_copy(caller_ptr->p_endpoint, \
table_v + (entry)*sizeof(asynmsg_t) + offsetof(struct asynmsg,field),\
- SYSTEM, (vir_bytes) &tabent.field, \
+ KERNEL, (vir_bytes) &tabent.field, \
sizeof(tabent.field)) != OK) {\
ASCOMPLAIN(caller_ptr, entry, #field); \
return EFAULT; \
}
#define A_INSERT(entry, field) \
- if(data_copy(SYSTEM, (vir_bytes) &tabent.field, \
+ if(data_copy(KERNEL, (vir_bytes) &tabent.field, \
caller_ptr->p_endpoint, \
table_v + (entry)*sizeof(asynmsg_t) + offsetof(struct asynmsg,field),\
sizeof(tabent.field)) != OK) {\
#define MF_REPLY_PEND 0x001 /* reply to IPC_REQUEST is pending */
#define MF_VIRT_TIMER 0x002 /* process-virtual timer is running */
#define MF_PROF_TIMER 0x004 /* process-virtual profile timer is running */
+#define MF_KCALL_RESUME 0x008 /* processing a kernel call was interrupted,
+ most likely because we need VM to resolve a
+ problem or a long running copy was preempted.
+ We need to resume the kernel call execution
+ now
+ */
#define MF_ASYNMSG 0x010 /* Asynchrous message pending */
#define MF_FULLVM 0x020
#define MF_DELIVERMSG 0x040 /* Copy message for him before running */
/* Note: k_reenter is always 0 here. */
/* Store sample (process name and program counter). */
- data_copy(SYSTEM, (vir_bytes) proc_ptr->p_name,
+ data_copy(KERNEL, (vir_bytes) proc_ptr->p_name,
sprof_ep, sprof_data_addr_vir + sprof_info.mem_used,
strlen(proc_ptr->p_name));
- data_copy(SYSTEM, (vir_bytes) &proc_ptr->p_reg.pc, sprof_ep,
+ data_copy(KERNEL, (vir_bytes) &proc_ptr->p_reg.pc, sprof_ep,
(vir_bytes) (sprof_data_addr_vir + sprof_info.mem_used +
sizeof(proc_ptr->p_name)),
(vir_bytes) sizeof(proc_ptr->p_reg.pc));
_PROTOTYPE( void send_sig, (int proc_nr, int sig_nr) );
_PROTOTYPE( void cause_sig, (proc_nr_t proc_nr, int sig_nr) );
_PROTOTYPE( void sig_delay_done, (struct proc *rp) );
-_PROTOTYPE( void sys_task, (void) );
+_PROTOTYPE( void kernel_call, (message *m_user, struct proc * caller) );
_PROTOTYPE( void system_init, (void) );
#define numap_local(proc_nr, vir_addr, bytes) \
umap_local(proc_addr(proc_nr), D, (vir_addr), (bytes))
_PROTOTYPE( phys_bytes umap_grant, (struct proc *, cp_grant_id_t, vir_bytes));
_PROTOTYPE( void clear_endpoint, (struct proc *rc) );
_PROTOTYPE( phys_bytes umap_bios, (vir_bytes vir_addr, vir_bytes bytes));
+_PROTOTYPE( void kernel_call_resume, (struct proc *p));
/* system/do_newmap.c */
_PROTOTYPE( int newmap, (struct proc * caller, struct proc *rp,
callnames[(call_nr-KERNEL_CALL)] = #call_nr; \
call_vec[(call_nr-KERNEL_CALL)] = (handler)
-FORWARD _PROTOTYPE( void initialize, (void));
-FORWARD _PROTOTYPE( struct proc *vmrestart_check, (message *));
+PRIVATE void kernel_call_finish(struct proc * caller, message *msg, int result)
+{
+ if(result == VMSUSPEND) {
+ /* Special case: message has to be saved for handling
+ * until VM tells us it's allowed. VM has been notified
+ * and we must wait for its reply to restart the call.
+ */
+ vmassert(RTS_ISSET(caller, RTS_VMREQUEST));
+ vmassert(caller->p_vmrequest.type == VMSTYPE_KERNELCALL);
+ caller->p_vmrequest.saved.reqmsg = *msg;
+ caller->p_misc_flags |= MF_KCALL_RESUME;
+ } else {
+ /*
+ * call is finished, we could have been suspended because of VM,
+ * remove the request message
+ */
+ caller->p_vmrequest.saved.reqmsg.m_source = NONE;
+ if (result != EDONTREPLY) {
+ /* copy the result as a message to the original user buffer */
+ msg->m_source = SYSTEM;
+ msg->m_type = result; /* report status of call */
+ if (copy_msg_to_user(caller, msg,
+ (message *)caller->p_delivermsg_vir)) {
+ kprintf("WARNING wrong user pointer 0x%08x from "
+ "process %s / %d\n",
+ caller->p_delivermsg_vir,
+ caller->p_name,
+ caller->p_endpoint);
+ result = EBADREQUEST;
+ }
+ }
+ }
+}
-/*===========================================================================*
- * sys_task *
- *===========================================================================*/
-PUBLIC void sys_task()
+PRIVATE int kernel_call_dispatch(struct proc * caller, message *msg)
{
-/* Main entry point of sys_task. Get the message and dispatch on type. */
- static message m;
- register int result;
- register struct proc *caller_ptr;
- int s;
+ int result = OK;
int call_nr;
- int who_p;
- endpoint_t who_e;
-
- while (TRUE) {
- struct proc *restarting;
-
- restarting = vmrestart_check(&m);
-
- if(!restarting) {
- int r;
- /* Get work. Block and wait until a request message arrives. */
- if((r=receive(ANY, &m)) != OK)
- minix_panic("receive() failed", r);
- }
- call_nr = m.m_type - KERNEL_CALL;
- who_e = m.m_source;
- okendpt(who_e, &who_p);
- caller_ptr = proc_addr(who_p);
+ call_nr = msg->m_type - KERNEL_CALL;
- /* See if the caller made a valid request and try to handle it. */
- if (call_nr < 0 || call_nr >= NR_SYS_CALLS) { /* check call number */
+ /* See if the caller made a valid request and try to handle it. */
+ if (call_nr < 0 || call_nr >= NR_SYS_CALLS) { /* check call number */
kprintf("SYSTEM: illegal request %d from %d.\n",
- call_nr,m.m_source);
+ call_nr,msg->m_source);
result = EBADREQUEST; /* illegal message type */
- }
- else if (!GET_BIT(priv(caller_ptr)->s_k_call_mask, call_nr)) {
+ }
+ else if (!GET_BIT(priv(caller)->s_k_call_mask, call_nr)) {
result = ECALLDENIED; /* illegal message type */
- }
- else {
+ } else {
/* handle the system call */
- result = (*call_vec[call_nr])(caller_ptr, &m);
- }
+ result = (*call_vec[call_nr])(caller, msg);
+ }
- if(result == VMSUSPEND) {
- /* Special case: message has to be saved for handling
- * until VM tells us it's allowed. VM has been notified
- * and we must wait for its reply to restart the call.
- */
- vmassert(RTS_ISSET(caller_ptr, RTS_VMREQUEST));
- vmassert(caller_ptr->p_vmrequest.type == VMSTYPE_KERNELCALL);
- caller_ptr->p_vmrequest.saved.reqmsg = m;
- } else if (result != EDONTREPLY) {
- /* Send a reply, unless inhibited by a handler function.
- * Use the kernel function lock_send() to prevent a system
- * call trap.
- */
- if(restarting) {
- vmassert(!RTS_ISSET(restarting, RTS_VMREQUEST));
-#if 0
- vmassert(!RTS_ISSET(restarting, RTS_VMREQTARGET));
-#endif
- }
- m.m_type = result; /* report status of call */
- if(WILLRECEIVE(caller_ptr, SYSTEM)) {
- if (OK != (s=lock_send(m.m_source, &m))) {
- kprintf("SYSTEM, reply to %d failed: %d\n",
- m.m_source, s);
- }
- } else {
- kprintf("SYSTEM: not replying to %d; not ready\n",
- caller_ptr->p_endpoint);
- }
- }
+ return result;
+}
+
+/*===========================================================================*
+ * kernel_call *
+ *===========================================================================*/
+/*
+ * this function checks the basic syscall parameters and if accepted it
+ * dispatches its handling to the right handler
+ */
+PUBLIC void kernel_call(message *m_user, struct proc * caller)
+{
+ int result = OK;
+ message msg;
+
+ caller->p_delivermsg_vir = (vir_bytes) m_user;
+ /*
+ * the ldt and cr3 of the caller process is loaded because it just've trapped
+ * into the kernel or was already set in schedcheck() before we resume
+ * execution of an interrupted kernel call
+ */
+ if (copy_msg_from_user(caller, m_user, &msg) == 0) {
+ msg.m_source = caller->p_endpoint;
+ result = kernel_call_dispatch(caller, &msg);
+ }
+ else {
+ kprintf("WARNING wrong user pointer 0x%08x from process %s / %d\n",
+ m_user, caller->p_name, caller->p_endpoint);
+ result = EBADREQUEST;
}
+
+ kernel_call_finish(caller, &msg, result);
}
/*===========================================================================*
}
/*===========================================================================*
- * vmrestart_check *
+ * kernel_call_resume *
*===========================================================================*/
-PRIVATE struct proc *vmrestart_check(message *m)
+PUBLIC void kernel_call_resume(struct proc *caller)
{
- int type;
- struct proc *restarting;
- int who_p;
-
- /* Anyone waiting to be vm-restarted? */
-
- if(!(restarting = vmrestart))
- return NULL;
-
- vmassert(!RTS_ISSET(restarting, RTS_SLOT_FREE));
- vmassert(RTS_ISSET(restarting, RTS_VMREQUEST));
-
- type = restarting->p_vmrequest.type;
- restarting->p_vmrequest.type = VMSTYPE_SYS_NONE;
- vmrestart = restarting->p_vmrequest.nextrestart;
-
- switch(type) {
- case VMSTYPE_KERNELCALL:
- *m = restarting->p_vmrequest.saved.reqmsg;
- restarting->p_vmrequest.saved.reqmsg.m_source = NONE;
- vmassert(m->m_source == restarting->p_endpoint);
- /* Original caller could've disappeared in the meantime. */
- if(!isokendpt(m->m_source, &who_p)) {
- kprintf("SYSTEM: ignoring call %d from dead %d\n",
- m->m_type, m->m_source);
- return NULL;
- }
- { int i;
- i = m->m_type - KERNEL_CALL;
- if(i >= 0 && i < NR_SYS_CALLS) {
-#if 0
- kprintf("SYSTEM: restart %s from %d\n",
- callnames[i], m->m_source);
-#endif
- } else {
- minix_panic("call number out of range", i);
- }
- }
- return restarting;
- default:
- minix_panic("strange restart type", type);
- }
- minix_panic("fell out of switch", NO_NUM);
- return NULL;
+ int result;
+
+ vmassert(!RTS_ISSET(p, RTS_SLOT_FREE));
+ vmassert(!RTS_ISSET(p, RTS_VMREQUEST));
+
+ vmassert(p->p_vmrequest.saved.reqmsg.m_source == p->p_endpoint);
+
+ /*
+ printf("KERNEL_CALL restart from %s / %d rts 0x%08x misc 0x%08x\n",
+ caller->p_name, caller->p_endpoint,
+ caller->p_rts_flags, caller->p_misc_flags);
+ */
+
+ /*
+ * we are resuming the kernel call so we have to remove this flag so it
+ * can be set again
+ */
+ caller->p_misc_flags &= ~MF_KCALL_RESUME;
+ result = kernel_call_dispatch(caller, &caller->p_vmrequest.saved.reqmsg);
+ kernel_call_finish(caller, &caller->p_vmrequest.saved.reqmsg, result);
}
int len;
len = MIN(m_ptr->ABRT_MON_LEN, sizeof(paramsbuffer)-1);
- if((p=data_copy(m_ptr->ABRT_MON_ENDPT,
- (vir_bytes) m_ptr->ABRT_MON_ADDR,
- SYSTEM, (vir_bytes) paramsbuffer, len)) != OK) {
+ if((p=data_copy(m_ptr->ABRT_MON_ENDPT, (vir_bytes) m_ptr->ABRT_MON_ADDR,
+ KERNEL, (vir_bytes) paramsbuffer, len)) != OK) {
return p;
}
paramsbuffer[len] = '\0';
}
/* Set reset flag. */
- data_copy(SYSTEM, (vir_bytes) &cprof_ctl_inst.reset,
+ data_copy(KERNEL, (vir_bytes) &cprof_ctl_inst.reset,
cprof_proc_info[i].endpt, cprof_proc_info[i].ctl_v,
sizeof(cprof_ctl_inst.reset));
}
/* Copy control struct from proc to local variable. */
data_copy(cprof_proc_info[i].endpt, cprof_proc_info[i].ctl_v,
- SYSTEM, (vir_bytes) &cprof_ctl_inst,
+ KERNEL, (vir_bytes) &cprof_ctl_inst,
sizeof(cprof_ctl_inst));
/* Calculate memory used. */
if (cprof_mem_size < cprof_info.mem_used) cprof_info.mem_used = -1;
/* Copy the info struct to the user process. */
- data_copy(SYSTEM, (vir_bytes) &cprof_info,
+ data_copy(KERNEL, (vir_bytes) &cprof_info,
m_ptr->PROF_ENDPT, (vir_bytes) m_ptr->PROF_CTL_PTR,
sizeof(cprof_info));
vir_dst = (vir_bytes) m_ptr->PROF_MEM_PTR;
for (i=0; i<cprof_procs_no; i++) {
len = (phys_bytes) strlen(cprof_proc_info[i].name);
- data_copy(SYSTEM, (vir_bytes) cprof_proc_info[i].name,
+ data_copy(KERNEL, (vir_bytes) cprof_proc_info[i].name,
m_ptr->PROF_ENDPT, vir_dst, len);
vir_dst += CPROF_PROCNAME_LEN;
/* Save command name for debugging, ps(1) output, etc. */
if(data_copy(caller->p_endpoint, (vir_bytes) m_ptr->PR_NAME_PTR,
- SYSTEM, (vir_bytes) rp->p_name, (phys_bytes) P_NAME_LEN - 1) != OK)
+ KERNEL, (vir_bytes) rp->p_name, (phys_bytes) P_NAME_LEN - 1) != OK)
strncpy(rp->p_name, "<unset>", P_NAME_LEN);
/* Do architecture-specific exec() stuff. */
/* Try to make the actual copy for the requested data. */
if (m_ptr->I_VAL_LEN > 0 && length > m_ptr->I_VAL_LEN) return (E2BIG);
- r = data_copy_vmcheck(caller, SYSTEM, src_vir, caller->p_endpoint,
+ r = data_copy_vmcheck(caller, KERNEL, src_vir, caller->p_endpoint,
(vir_bytes) m_ptr->I_VAL_PTR, length);
if(r != OK) return r;
int r;
/* Fetch the memory map. */
if((r=data_copy(caller->p_endpoint, (vir_bytes) map_ptr,
- SYSTEM, (vir_bytes) rp->p_memmap, sizeof(rp->p_memmap))) != OK) {
+ KERNEL, (vir_bytes) rp->p_memmap, sizeof(rp->p_memmap))) != OK) {
kprintf("newmap: data_copy failed! (%d)\n", r);
return r;
}
{
/* Copy privilege structure from caller */
if((r=data_copy(caller->p_endpoint, (vir_bytes) m_ptr->CTL_ARG_PTR,
- SYSTEM, (vir_bytes) &priv, sizeof(priv))) != OK)
+ KERNEL, (vir_bytes) &priv, sizeof(priv))) != OK)
return r;
/* See if the caller wants to assign a static privilege id. */
/* Get the I/O range */
data_copy(caller->p_endpoint, (vir_bytes) m_ptr->CTL_ARG_PTR,
- SYSTEM, (vir_bytes) &io_range, sizeof(io_range));
+ KERNEL, (vir_bytes) &io_range, sizeof(io_range));
priv(rp)->s_flags |= CHECK_IO_PORT; /* Check I/O accesses */
i= priv(rp)->s_nr_io_range;
if (i >= NR_IO_RANGE)
/* Get the memory range */
if((r=data_copy(caller->p_endpoint, (vir_bytes) m_ptr->CTL_ARG_PTR,
- SYSTEM, (vir_bytes) &mem_range, sizeof(mem_range))) != OK)
+ KERNEL, (vir_bytes) &mem_range, sizeof(mem_range))) != OK)
return r;
priv(rp)->s_flags |= CHECK_MEM; /* Check memory mappings */
i= priv(rp)->s_nr_mem_range;
return EPERM;
data_copy(caller->p_endpoint, (vir_bytes) m_ptr->CTL_ARG_PTR,
- SYSTEM, (vir_bytes) &irq, sizeof(irq));
+ KERNEL, (vir_bytes) &irq, sizeof(irq));
priv(rp)->s_flags |= CHECK_IRQ; /* Check IRQs */
i= priv(rp)->s_nr_irq;
*/
if((r=data_copy(granter,
priv(granter_proc)->s_grant_table + sizeof(g)*grant,
- SYSTEM, (vir_bytes) &g, sizeof(g))) != OK) {
+ KERNEL, (vir_bytes) &g, sizeof(g))) != OK) {
kprintf(
"verify_grant: grant verify: data_copy failed\n");
return EPERM;
src.proc_nr_e = caller->p_endpoint;
src.offset = (vir_bytes) m_ptr->VSCP_VEC_ADDR;
src.segment = dst.segment = D;
- dst.proc_nr_e = SYSTEM;
+ dst.proc_nr_e = KERNEL;
dst.offset = (vir_bytes) vec;
/* No. of vector elements. */
/* Copy in the sigcontext structure. */
if((r=data_copy(m_ptr->SIG_ENDPT, (vir_bytes) m_ptr->SIG_CTXT_PTR,
- SYSTEM, (vir_bytes) &sc, sizeof(struct sigcontext))) != OK)
+ KERNEL, (vir_bytes) &sc, sizeof(struct sigcontext))) != OK)
return r;
/* Restore user bits of psw from sc, maintain system bits from proc. */
/* Get the sigmsg structure into our address space. */
if((r=data_copy_vmcheck(caller, caller->p_endpoint,
- (vir_bytes) m_ptr->SIG_CTXT_PTR, SYSTEM, (vir_bytes) &smsg,
+ (vir_bytes) m_ptr->SIG_CTXT_PTR, KERNEL, (vir_bytes) &smsg,
(phys_bytes) sizeof(struct sigmsg))) != OK)
return r;
sc.sc_flags = 0 | rp->p_misc_flags & MF_FPU_INITIALIZED;
/* Copy the sigcontext structure to the user's stack. */
- if((r=data_copy_vmcheck(caller, SYSTEM, (vir_bytes) &sc, m_ptr->SIG_ENDPT,
+ if((r=data_copy_vmcheck(caller, KERNEL, (vir_bytes) &sc, m_ptr->SIG_ENDPT,
(vir_bytes) scp, (vir_bytes) sizeof(struct sigcontext))) != OK)
return r;
fr.sf_retadr = (void (*)()) smsg.sm_sigreturn;
/* Copy the sigframe structure to the user's stack. */
- if((r=data_copy_vmcheck(caller, SYSTEM, (vir_bytes) &fr,
+ if((r=data_copy_vmcheck(caller, KERNEL, (vir_bytes) &fr,
m_ptr->SIG_ENDPT, (vir_bytes) frp,
(vir_bytes) sizeof(struct sigframe))) != OK)
return r;
stop_profile_clock();
- data_copy(SYSTEM, (vir_bytes) &sprof_info,
+ data_copy(KERNEL, (vir_bytes) &sprof_info,
sprof_ep, sprof_info_addr_vir, sizeof(sprof_info));
return OK;
caller->p_endpoint, len);
return EINVAL;
}
- if((s=data_copy_vmcheck(caller, caller->p_endpoint, buf, SYSTEM,
+ if((s=data_copy_vmcheck(caller, caller->p_endpoint, buf, KERNEL,
(vir_bytes) mybuf, len)) != OK) {
kprintf("do_sysctl: diag for %d: len %d: copy failed: %d\n",
caller->p_endpoint, len, s);
#define COPYTOPROC(seg, addr, myaddr, length) { \
struct vir_addr fromaddr, toaddr; \
int r; \
- fromaddr.proc_nr_e = SYSTEM; \
+ fromaddr.proc_nr_e = KERNEL; \
toaddr.proc_nr_e = tr_proc_nr_e; \
fromaddr.offset = (myaddr); \
toaddr.offset = (addr); \
struct vir_addr fromaddr, toaddr; \
int r; \
fromaddr.proc_nr_e = tr_proc_nr_e; \
- toaddr.proc_nr_e = SYSTEM; \
+ toaddr.proc_nr_e = KERNEL; \
fromaddr.offset = (addr); \
toaddr.offset = (myaddr); \
fromaddr.segment = (seg); \
/* Copy (port,value)-pairs from user. */
if((r=data_copy(caller->p_endpoint, (vir_bytes) m_ptr->DIO_VEC_ADDR,
- SYSTEM, (vir_bytes) vdevio_buf, bytes)) != OK)
+ KERNEL, (vir_bytes) vdevio_buf, bytes)) != OK)
return r;
privp= priv(caller);
* the entire switch is wrapped in lock() and unlock() to prevent the I/O
* batch from being interrupted.
*/
-#if 0
- if(who_e == 71091) {
- static int vd = 0;
- if(vd++ < 100) {
- kprintf("proc %d does vdevio no %d; type %d, direction %s\n",
- who_e, vd, io_type, io_in ? "input" : "output");
- kprintf("(");
- for (i=0; i<vec_size; i++)
- kprintf("%2d:0x%x,0x%x ", i, pvb[i].port, pvb[i].value);
- kprintf(")\n");
- }
- }
-#endif
lock;
switch (io_type) {
case _DIO_BYTE: /* byte values */
/* Almost done, copy back results for input requests. */
if (io_in)
- if((r=data_copy(SYSTEM, (vir_bytes) vdevio_buf,
+ if((r=data_copy(KERNEL, (vir_bytes) vdevio_buf,
caller->p_endpoint, (vir_bytes) m_ptr->DIO_VEC_ADDR,
(phys_bytes) bytes)) != OK)
return r;
switch(p->p_vmrequest.type) {
case VMSTYPE_KERNELCALL:
- /* Put on restart chain. */
- p->p_vmrequest.nextrestart = vmrestart;
- vmrestart = p;
+ /*
+ * we will have to resume execution of the kernel call
+ * as soon the scheduler picks up this process again
+ */
+ p->p_misc_flags |= MF_KCALL_RESUME;
break;
case VMSTYPE_DELIVERMSG:
vmassert(p->p_misc_flags & MF_DELIVERMSG);
vmassert(p == target);
vmassert(RTS_ISSET(p, RTS_VMREQUEST));
- RTS_LOCK_UNSET(p, RTS_VMREQUEST);
break;
case VMSTYPE_MAP:
vmassert(RTS_ISSET(p, RTS_VMREQUEST));
- RTS_LOCK_UNSET(p, RTS_VMREQUEST);
break;
default:
#if DEBUG_VMASSERT
p->p_vmrequest.type);
}
+ RTS_LOCK_UNSET(p, RTS_VMREQUEST);
return OK;
+
case VMCTL_ENABLE_PAGING:
/*
* system task must not get preempted while switching to paging,
/* process nr, pc, flags, qs, queue, stack, name */
{IDLE, NULL, 0, 0, 0, IDL_S, "idle" },
{CLOCK,clock_task, 0, 8, TASK_Q, TSK_S, "clock" },
-{SYSTEM, sys_task, 0, 8, TASK_Q, TSK_S, "system"},
+{SYSTEM, NULL, 0, 0, 0, IDL_S, "system"},
{HARDWARE, 0, 0, 8, TASK_Q, HRD_S, "kernel"},
{PM_PROC_NR, 0, 0, 32, 4, 0, "pm" },
{FS_PROC_NR, 0, 0, 32, 5, 0, "vfs" },
.sect .text; .sect .rom; .sect .data; .sect .bss
-.define __notify, __send, __senda, __sendnb, __receive, __sendrec
+.define __notify, __send, __senda, __sendnb, __receive, __sendrec, __do_kernel_call
! See src/kernel/ipc.h for C definitions
SEND = 1
SENDREC = 3
NOTIFY = 4
SENDNB = 5
-SYSVEC = 33 ! trap to kernel
+IPCVEC = 33 ! ipc trap to kernel
+KERVEC = 32 ! syscall trap to kernel
SRC_DST = 8 ! source/ destination process
MESSAGE = 12 ! message pointer
mov eax, SRC_DST(ebp) ! eax = dest-src
mov ebx, MESSAGE(ebp) ! ebx = message pointer
mov ecx, SEND ! _send(dest, ptr)
- int SYSVEC ! trap to the kernel
+ int IPCVEC ! trap to the kernel
pop ebx
pop ebp
ret
mov eax, SRC_DST(ebp) ! eax = dest-src
mov ebx, MESSAGE(ebp) ! ebx = message pointer
mov ecx, RECEIVE ! _receive(src, ptr)
- int SYSVEC ! trap to the kernel
+ int IPCVEC ! trap to the kernel
pop ebx
pop ebp
ret
mov eax, SRC_DST(ebp) ! eax = dest-src
mov ebx, MESSAGE(ebp) ! ebx = message pointer
mov ecx, SENDREC ! _sendrec(srcdest, ptr)
- int SYSVEC ! trap to the kernel
+ int IPCVEC ! trap to the kernel
pop ebx
pop ebp
ret
push ebx
mov eax, SRC_DST(ebp) ! eax = destination
mov ecx, NOTIFY ! _notify(srcdst)
- int SYSVEC ! trap to the kernel
+ int IPCVEC ! trap to the kernel
pop ebx
pop ebp
ret
mov eax, SRC_DST(ebp) ! eax = dest-src
mov ebx, MESSAGE(ebp) ! ebx = message pointer
mov ecx, SENDNB ! _sendnb(dest, ptr)
- int SYSVEC ! trap to the kernel
+ int IPCVEC ! trap to the kernel
pop ebx
pop ebp
ret
-
+__do_kernel_call:
+ ! pass the message pointer to kernel in the %eax register
+ mov eax, 4(esp)
+ int KERVEC
+ ret
libsys_FILES=" \
alloc_util.c \
assert.c \
+ kernel_call.c \
panic.c \
pci_attr_r16.c \
pci_attr_r32.c \
}
va_end(ap);
- return(_taskcall(SYSTASK, SYS_ABORT, &m));
+ return(_kernel_call(SYS_ABORT, &m));
}
m.PROF_CTL_PTR = ctl_ptr;
m.PROF_MEM_PTR = mem_ptr;
- return(_taskcall(SYSTASK, SYS_CPROF, &m));
+ return(_kernel_call(SYS_CPROF, &m));
}
int result;
m.SIG_ENDPT = proc_ep;
- result = _taskcall(SYSTASK, SYS_ENDKSIG, &m);
+ result = _kernel_call(SYS_ENDKSIG, &m);
return(result);
}
{
message m_iop;
m_iop.IO_ENDPT = proc_ep;
- return _taskcall(SYSTASK, SYS_IOPENABLE, &m_iop);
+ return _kernel_call(SYS_IOPENABLE, &m_iop);
}
m.PR_STACK_PTR = ptr;
m.PR_NAME_PTR = prog_name;
m.PR_IP_PTR = (char *)initpc;
- return(_taskcall(SYSTASK, SYS_EXEC, &m));
+ return(_kernel_call(SYS_EXEC, &m));
}
message m;
m.PR_ENDPT = proc_ep;
- return(_taskcall(SYSTASK, SYS_EXIT, &m));
+ return(_kernel_call(SYS_EXIT, &m));
}
m.PR_SLOT = child;
m.PR_MEM_PTR = (char *) map_ptr;
m.PR_FORK_FLAGS = flags;
- r = _taskcall(SYSTASK, SYS_FORK, &m);
+ r = _kernel_call(SYS_FORK, &m);
*child_endpoint = m.PR_ENDPT;
*msgaddr = (vir_bytes) m.PR_FORK_MSGADDR;
return r;
m.I_VAL_PTR2 = ptr2;
m.I_VAL_LEN2_E = len2;
- return(_taskcall(SYSTASK, SYS_GETINFO, &m));
+ return(_kernel_call(SYS_GETINFO, &m));
}
/*===========================================================================*
if(len < 2)
return EINVAL;
- if((r = _taskcall(SYSTASK, SYS_GETINFO, &m)) != OK)
+ if((r = _kernel_call(SYS_GETINFO, &m)) != OK)
return r;
lenmin = MIN(len, sizeof(m.GIWHO_NAME)) - 1;
message m;
int result;
- result = _taskcall(SYSTASK, SYS_GETKSIG, &m);
+ result = _kernel_call(SYS_GETKSIG, &m);
*proc_ep = m.SIG_ENDPT;
*k_sig_map = (sigset_t) m.SIG_MAP;
return(result);
m_io.DIO_REQUEST = _DIO_INPUT | type;
m_io.DIO_PORT = port;
- result = _taskcall(SYSTASK, SYS_DEVIO, &m_io);
+ result = _kernel_call(SYS_DEVIO, &m_io);
*value = m_io.DIO_VALUE;
return(result);
}
m.m1_p1= (char *)reg86p;
- result = _taskcall(SYSTASK, SYS_INT86, &m);
+ result = _kernel_call(SYS_INT86, &m);
return(result);
}
m_irq.IRQ_POLICY = policy;
m_irq.IRQ_HOOK_ID = *hook_id;
- s = _taskcall(SYSTASK, SYS_IRQCTL, &m_irq);
+ s = _kernel_call(SYS_IRQCTL, &m_irq);
if (req == IRQ_SETPOLICY) *hook_id = m_irq.IRQ_HOOK_ID;
return(s);
}
m.SIG_ENDPT = proc_ep;
m.SIG_NUMBER = signr;
- return(_taskcall(SYSTASK, SYS_KILL, &m));
+ return(_kernel_call(SYS_KILL, &m));
}
mess.MEM_COUNT = bytes;
mess.MEM_PATTERN = pattern;
- return(_taskcall(SYSTASK, SYS_MEMSET, &mess));
+ return(_kernel_call(SYS_MEMSET, &mess));
}
m.PR_ENDPT = proc_ep;
m.PR_MEM_PTR = (char *) ptr;
- return(_taskcall(SYSTASK, SYS_NEWMAP, &m));
+ return(_kernel_call(SYS_NEWMAP, &m));
}
m.PR_ENDPT = proc_ep;
m.PR_PRIORITY = prio;
- return(_taskcall(SYSTASK, SYS_NICE, &m));
+ return(_kernel_call(SYS_NICE, &m));
}
m_io.DIO_PORT = port;
m_io.DIO_VALUE = value;
- return _taskcall(SYSTASK, SYS_DEVIO, &m_io);
+ return _kernel_call(SYS_DEVIO, &m_io);
}
copy_mess.CP_DST_SPACE = dst_seg;
copy_mess.CP_DST_ADDR = (long) dst_vir;
copy_mess.CP_NR_BYTES = (long) bytes;
- return(_taskcall(SYSTASK, SYS_PHYSCOPY, ©_mess));
+ return(_kernel_call(SYS_PHYSCOPY, ©_mess));
}
m.CTL_REQUEST = request;
m.CTL_ARG_PTR = p;
- return _taskcall(SYSTASK, SYS_PRIVCTL, &m);
+ return _kernel_call(SYS_PRIVCTL, &m);
}
int sys_privquery_mem(endpoint_t proc_ep, phys_bytes start, phys_bytes len)
m.CTL_PHYSSTART = start;
m.CTL_PHYSLEN = len;
- return _taskcall(SYSTASK, SYS_PRIVCTL, &m);
+ return _kernel_call(SYS_PRIVCTL, &m);
}
m.PROF_CTL_PTR = ctl_ptr;
m.PROF_MEM_PTR = mem_ptr;
- return(_taskcall(SYSTASK, SYS_PROFBUF, &m));
+ return(_kernel_call(SYS_PROFBUF, &m));
}
m.RDB_SIZE = size;
m.RDB_ADDR = address;
m.RDB_BUF = buf;
- return(_taskcall(SYSTASK, SYS_READBIOS, &m));
+ return(_kernel_call(SYS_READBIOS, &m));
}
m.RC_ACTION = action;
m.RC_FLAGS = flags;
- return(_taskcall(SYSTASK, SYS_RUNCTL, &m));
+ return(_kernel_call(SYS_RUNCTL, &m));
}
copy_mess.SCP_ADDRESS = (char *) address;
copy_mess.SCP_BYTES = (long) bytes;
- return(_taskcall(SYSTASK, SYS_SAFECOPYFROM, ©_mess));
+ return(_kernel_call(SYS_SAFECOPYFROM, ©_mess));
}
copy_mess.SCP_ADDRESS = (char *) address;
copy_mess.SCP_BYTES = (long) bytes;
- return(_taskcall(SYSTASK, SYS_SAFECOPYTO, ©_mess));
+ return(_kernel_call(SYS_SAFECOPYTO, ©_mess));
}
copy_mess.SMAP_BYTES = bytes;
copy_mess.SMAP_FLAG = writable;
- return(_taskcall(SYSTASK, SYS_SAFEMAP, ©_mess));
+ return(_kernel_call(SYS_SAFEMAP, ©_mess));
}
copy_mess.SMAP_FLAG = 1;
copy_mess.SMAP_GID = grant;
- return(_taskcall(SYSTASK, SYS_SAFEREVMAP, ©_mess));
+ return(_kernel_call(SYS_SAFEREVMAP, ©_mess));
}
/*===========================================================================*
copy_mess.SMAP_FLAG = 0;
copy_mess.SMAP_GID = addr;
- return(_taskcall(SYSTASK, SYS_SAFEREVMAP, ©_mess));
+ return(_kernel_call(SYS_SAFEREVMAP, ©_mess));
}
/*===========================================================================*
copy_mess.SMAP_SEG = (void*) my_seg;
copy_mess.SMAP_ADDRESS = my_address;
- return(_taskcall(SYSTASK, SYS_SAFEUNMAP, ©_mess));
+ return(_kernel_call(SYS_SAFEUNMAP, ©_mess));
}
m_io.DIO_VEC_SIZE = count;
m_io.DIO_OFFSET = offset;
- return(_taskcall(SYSTASK, SYS_SDEVIO, &m_io));
+ return(_kernel_call(SYS_SDEVIO, &m_io));
}
int s;
m.SEG_PHYS = phys;
m.SEG_SIZE = size;
- s = _taskcall(SYSTASK, SYS_SEGCTL, &m);
+ s = _kernel_call(SYS_SEGCTL, &m);
*index = (int) m.SEG_INDEX;
*seg = (u16_t) m.SEG_SELECT;
*off = (vir_bytes) m.SEG_OFFSET;
message m;
m.ALRM_EXP_TIME = exp_time; /* the expiration time */
m.ALRM_ABS_TIME = abs_time; /* time is absolute? */
- return _taskcall(SYSTASK, SYS_SETALARM, &m);
+ return _kernel_call(SYS_SETALARM, &m);
}
m.SG_ADDR = (char *) grants;
m.SG_SIZE = ngrants;
- return _taskcall(SYSTASK, SYS_SETGRANT, &m);
+ return _kernel_call(SYS_SETGRANT, &m);
}
m.SIG_ENDPT = proc_ep;
m.SIG_CTXT_PTR = (char *) sig_ctxt;
- result = _taskcall(SYSTASK, SYS_SIGRETURN, &m);
+ result = _kernel_call(SYS_SIGRETURN, &m);
return(result);
}
m.SIG_ENDPT = proc_ep;
m.SIG_CTXT_PTR = (char *) sig_ctxt;
- result = _taskcall(SYSTASK, SYS_SIGSEND, &m);
+ result = _kernel_call(SYS_SIGSEND, &m);
return(result);
}
m.PROF_CTL_PTR = ctl_ptr;
m.PROF_MEM_PTR = mem_ptr;
- return(_taskcall(SYSTASK, SYS_SPROF, &m));
+ return(_kernel_call(SYS_SPROF, &m));
}
#endif
int r;
m.T_BOOTTIME = boottime;
- r = _taskcall(SYSTASK, SYS_STIME, &m);
+ r = _kernel_call(SYS_STIME, &m);
return(r);
}
m.SYSCTL_ARG1 = arg1;
m.SYSCTL_ARG2 = arg2;
- return(_taskcall(SYSTASK, SYS_SYSCTL, &m));
+ return(_kernel_call(SYS_SYSCTL, &m));
}
int r;
m.T_ENDPT = proc_ep;
- r = _taskcall(SYSTASK, SYS_TIMES, &m);
+ r = _kernel_call(SYS_TIMES, &m);
if (user_time) *user_time = m.T_USER_TIME;
if (sys_time) *sys_time = m.T_SYSTEM_TIME;
if (uptime) *uptime = m.T_BOOT_TICKS;
m.CTL_REQUEST = req;
m.CTL_ADDRESS = addr;
if (data_p) m.CTL_DATA = *data_p;
- r = _taskcall(SYSTASK, SYS_TRACE, &m);
+ r = _kernel_call(SYS_TRACE, &m);
if (data_p) *data_p = m.CTL_DATA;
return(r);
}
m.CP_SRC_ADDR = vir_addr;
m.CP_NR_BYTES = bytes;
- result = _taskcall(SYSTASK, SYS_UMAP, &m);
+ result = _kernel_call(SYS_UMAP, &m);
*phys_addr = m.CP_DST_ADDR;
return(result);
}
m_io.DIO_REQUEST = _DIO_INPUT | _DIO_BYTE;
m_io.DIO_VEC_ADDR = (char *) pvb_pairs;
m_io.DIO_VEC_SIZE = nr_ports;
- return _taskcall(SYSTASK, SYS_VDEVIO, &m_io);
+ return _kernel_call(SYS_VDEVIO, &m_io);
}
m_io.DIO_REQUEST = _DIO_INPUT | _DIO_LONG;
m_io.DIO_VEC_ADDR = (char *) pvl_pairs;
m_io.DIO_VEC_SIZE = nr_ports;
- return _taskcall(SYSTASK, SYS_VDEVIO, &m_io);
+ return _kernel_call(SYS_VDEVIO, &m_io);
}
m_io.DIO_REQUEST = _DIO_WORD | _DIO_INPUT;
m_io.DIO_VEC_ADDR = (char *) pvw_pairs;
m_io.DIO_VEC_SIZE = nr_ports;
- return _taskcall(SYSTASK, SYS_VDEVIO, &m_io);
+ return _kernel_call(SYS_VDEVIO, &m_io);
}
copy_mess.CP_DST_SPACE = dst_seg;
copy_mess.CP_DST_ADDR = (long) dst_vir;
copy_mess.CP_NR_BYTES = (long) bytes;
- return(_taskcall(SYSTASK, SYS_VIRCOPY, ©_mess));
+ return(_kernel_call(SYS_VIRCOPY, ©_mess));
}
m.SVMCTL_WHO = who;
m.SVMCTL_PARAM = param;
m.SVMCTL_VALUE = value;
- r = _taskcall(SYSTASK, SYS_VMCTL, &m);
+ r = _kernel_call(SYS_VMCTL, &m);
return(r);
}
m.SVMCTL_WHO = SELF;
m.SVMCTL_PARAM = VMCTL_GET_PAGEFAULT;
- r = _taskcall(SYSTASK, SYS_VMCTL, &m);
+ r = _kernel_call(SYS_VMCTL, &m);
if(r == OK) {
*who = m.SVMCTL_PF_WHO;
*cr2 = m.SVMCTL_PF_I386_CR2;
m.SVMCTL_WHO = who;
m.SVMCTL_PARAM = VMCTL_I386_GETCR3;
- r = _taskcall(SYSTASK, SYS_VMCTL, &m);
+ r = _kernel_call(SYS_VMCTL, &m);
if(r == OK) {
*cr3 = m.SVMCTL_VALUE;
}
m.SVMCTL_WHO = SELF;
m.SVMCTL_PARAM = VMCTL_MEMREQ_GET;
- r = _taskcall(SYSTASK, SYS_VMCTL, &m);
+ r = _kernel_call(SYS_VMCTL, &m);
if(r >= 0) {
*who = m.SVMCTL_MRG_TARGET;
*mem = m.SVMCTL_MRG_ADDR;
m.SVMCTL_WHO = SELF;
m.SVMCTL_PARAM = VMCTL_ENABLE_PAGING;
m.SVMCTL_VALUE = (int) map;
- return _taskcall(SYSTASK, SYS_VMCTL, &m);
+ return _kernel_call(SYS_VMCTL, &m);
}
PUBLIC int sys_vmctl_get_mapping(int index,
m.SVMCTL_PARAM = VMCTL_KERN_PHYSMAP;
m.SVMCTL_VALUE = (int) index;
- r = _taskcall(SYSTASK, SYS_VMCTL, &m);
+ r = _kernel_call(SYS_VMCTL, &m);
if(r != OK)
return r;
m.SVMCTL_VALUE = index;
m.SVMCTL_MAP_VIR_ADDR = (char *) addr;
- return _taskcall(SYSTASK, SYS_VMCTL, &m);
+ return _kernel_call(SYS_VMCTL, &m);
}
m_io.DIO_REQUEST = _DIO_OUTPUT | _DIO_BYTE;
m_io.DIO_VEC_ADDR = (char *) pvb_pairs;
m_io.DIO_VEC_SIZE = nr_ports;
- return _taskcall(SYSTASK, SYS_VDEVIO, &m_io);
+ return _kernel_call(SYS_VDEVIO, &m_io);
}
m_io.DIO_REQUEST = _DIO_OUTPUT | _DIO_LONG;
m_io.DIO_VEC_ADDR = (char *) pvl_pairs;
m_io.DIO_VEC_SIZE = nr_ports;
- return _taskcall(SYSTASK, SYS_VDEVIO, &m_io);
+ return _kernel_call(SYS_VDEVIO, &m_io);
}
m_io.DIO_REQUEST = _DIO_OUTPUT | _DIO_WORD;
m_io.DIO_VEC_ADDR = (char *) pvw_pairs;
m_io.DIO_VEC_SIZE = nr_ports;
- return _taskcall(SYSTASK, SYS_VDEVIO, &m_io);
+ return _kernel_call(SYS_VDEVIO, &m_io);
}
copy_mess.VSCP_VEC_ADDR = (char *) vec;
copy_mess.VSCP_VEC_SIZE = els;
- return(_taskcall(SYSTASK, SYS_VSAFECOPY, ©_mess));
+ return(_kernel_call(SYS_VSAFECOPY, ©_mess));
}
m.VT_SET = 0;
}
- r = _taskcall(SYSTASK, SYS_VTIMER, &m);
+ r = _kernel_call(SYS_VTIMER, &m);
if (oldval != NULL) {
*oldval = m.VT_VALUE;
m.I_ENDPT = SELF;
m.I_VAL_LEN = sizeof(mon_params);
m.I_VAL_PTR = mon_params;
- if ((s=_taskcall(SYSTASK, SYS_GETINFO, &m)) != OK) {
+ if ((s=_kernel_call(SYS_GETINFO, &m)) != OK) {
printf("SYS_GETINFO: %d (size %u)\n", s, sizeof(mon_params));
return(s);
}
m.m_type = SYS_TIMES; /* request time information */
m.T_ENDPT = NONE; /* ignore process times */
- s = _taskcall(SYSTASK, SYS_TIMES, &m);
+ s = _kernel_call(SYS_TIMES, &m);
*ticks = m.T_BOOT_TICKS;
return(s);
}
m.m_type = SYS_TIMES; /* request time information */
m.T_ENDPT = NONE; /* ignore process times */
- s = _taskcall(SYSTASK, SYS_TIMES, &m);
+ s = _kernel_call(SYS_TIMES, &m);
*ticks = m.T_BOOT_TICKS;
*boottime = m.T_BOOTTIME;
return(s);
m.ALRM_EXP_TIME = ticks; /* request message after ticks */
m.ALRM_ABS_TIME = 0; /* ticks are relative to now */
- s = _taskcall(SYSTASK, SYS_SETALARM, &m);
+ s = _kernel_call(SYS_SETALARM, &m);
if (s != OK) return(s);
receive(CLOCK,&m_alarm); /* await synchronous alarm */
m.ALRM_EXP_TIME = m.ALRM_TIME_LEFT - ticks;
if (m.ALRM_EXP_TIME <= 0)
m.ALRM_EXP_TIME = 1;
- s = _taskcall(SYSTASK, SYS_SETALARM, &m);
+ s = _kernel_call(SYS_SETALARM, &m);
}
return(s);