Various fixes and improvements.
- fixed bug that caused IDLE to panic (irq hook inconsistency); - kprintf() now accepts multiple arguments; moved to utility.c; - prepare_shutdown() signals system processes with SIGKSTOP; - phys_fill() renamed to phys_memset(), argument order changed; - kmemset() removed in favor of phys_kmemset(); - kstrncpy() removed in favor of phys_copy(); - katoi, kstrncmp replaced by normal library procedure again; - rm_irq_handler() interface changed (simply pass hook pointer);
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
* m1_p3: PR_IP_PTR (new instruction pointer)
|
||||
*/
|
||||
#include "../system.h"
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
|
||||
#if USE_EXEC
|
||||
@@ -35,7 +36,7 @@ register message *m_ptr; /* pointer to request message */
|
||||
#endif
|
||||
#endif
|
||||
#if (CHIP == INTEL) /* wipe extra LDT entries */
|
||||
kmemset(&rp->p_ldt[EXTRA_LDT_INDEX], 0,
|
||||
phys_memset(vir2phys(&rp->p_ldt[EXTRA_LDT_INDEX]), 0,
|
||||
(LDT_SIZE - EXTRA_LDT_INDEX) * sizeof(rp->p_ldt[0]));
|
||||
#endif
|
||||
rp->p_reg.pc = (reg_t) m_ptr->PR_IP_PTR; /* set pc */
|
||||
@@ -50,7 +51,7 @@ register message *m_ptr; /* pointer to request message */
|
||||
for (np = rp->p_name; (*np & BYTE) >= ' '; np++) {}
|
||||
*np = 0; /* mark end */
|
||||
} else {
|
||||
kstrncpy(rp->p_name, "<unset>", P_NAME_LEN);
|
||||
strncpy(rp->p_name, "<unset>", P_NAME_LEN);
|
||||
}
|
||||
return(OK);
|
||||
}
|
||||
|
||||
@@ -28,13 +28,13 @@ message *m_ptr; /* pointer to request message */
|
||||
exit_proc_nr = m_ptr->PR_PROC_NR; /* get exiting process */
|
||||
if (exit_proc_nr != SELF) { /* PM tries to exit self */
|
||||
if (! isokprocn(exit_proc_nr)) return(EINVAL);
|
||||
clear_proc(exit_proc_nr); /* exit a user process */
|
||||
clear_proc(proc_addr(exit_proc_nr)); /* exit a user process */
|
||||
return(OK); /* report back to PM */
|
||||
}
|
||||
}
|
||||
|
||||
/* The PM or some other system process requested to be exited. */
|
||||
clear_proc(m_ptr->m_source);
|
||||
clear_proc(proc_addr(m_ptr->m_source));
|
||||
return(EDONTREPLY);
|
||||
}
|
||||
#endif /* USE_EXIT */
|
||||
|
||||
@@ -80,9 +80,9 @@ register message *m_ptr; /* pointer to request message */
|
||||
return(EINVAL);
|
||||
} else if (m_ptr->m_source != irq_hooks[irq_hook_id].proc_nr) {
|
||||
return(EPERM);
|
||||
} else {
|
||||
r = rm_irq_handler(irq_vec, irq_hooks[irq_hook_id].id);
|
||||
}
|
||||
/* Remove the handler and return. */
|
||||
rm_irq_handler(&irq_hooks[irq_hook_id]);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -18,10 +18,10 @@ PUBLIC int do_memset(m_ptr)
|
||||
register message *m_ptr;
|
||||
{
|
||||
/* Handle sys_memset(). */
|
||||
unsigned long pat;
|
||||
unsigned long p;
|
||||
unsigned char c = m_ptr->MEM_CHAR;
|
||||
pat = c | (c << 8) | (c << 16) | (c << 24);
|
||||
phys_fill((phys_bytes) m_ptr->MEM_PTR, (phys_bytes) m_ptr->MEM_COUNT, pat);
|
||||
p = c | (c << 8) | (c << 16) | (c << 24);
|
||||
phys_memset((phys_bytes) m_ptr->MEM_PTR, p, (phys_bytes) m_ptr->MEM_COUNT);
|
||||
return(OK);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user