KCall methods do not depend on m_source and m_type fields
- substituted the use of the m_source message field by caller->p_endpoint in kernel calls. It is the same information, just passed more intuitively. - the last dependency on m_type field is removed. - do_unused() is substituted by a check for NULL. - this pretty much removes the depency of kernel calls on the general message format. In the future this may be used to pass the kcall arguments in a different structure or registers (x86-64, ARM?) The kcall number may be passed in a register already.
This commit is contained in:
@@ -109,7 +109,13 @@ PRIVATE int kernel_call_dispatch(struct proc * caller, message *msg)
|
||||
result = ECALLDENIED; /* illegal message type */
|
||||
} else {
|
||||
/* handle the system call */
|
||||
result = (*call_vec[call_nr])(caller, msg);
|
||||
if (call_vec[call_nr])
|
||||
result = (*call_vec[call_nr])(caller, msg);
|
||||
else {
|
||||
printf("Unused kernel call %d from %d\n",
|
||||
call_nr, caller->p_endpoint);
|
||||
result = EBADREQUEST;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -170,7 +176,7 @@ PUBLIC void system_init(void)
|
||||
* if an illegal call number is used. The ordering is not important here.
|
||||
*/
|
||||
for (i=0; i<NR_SYS_CALLS; i++) {
|
||||
call_vec[i] = do_unused;
|
||||
call_vec[i] = NULL;
|
||||
callnames[i] = "unused";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user