More endpoint_t correctness.
More const correctness. Other code cleanup.
This commit is contained in:
parent
4c10a31440
commit
826b9590f2
@ -29,8 +29,8 @@ _PROTOTYPE( void *mmap, (void *, size_t, int, int, int, off_t));
|
|||||||
_PROTOTYPE( int munmap, (void *, size_t));
|
_PROTOTYPE( int munmap, (void *, size_t));
|
||||||
_PROTOTYPE( int munmap_text, (void *, size_t));
|
_PROTOTYPE( int munmap_text, (void *, size_t));
|
||||||
_PROTOTYPE( void *vm_remap, (int d, int s, void *da, void *sa, size_t si));
|
_PROTOTYPE( void *vm_remap, (int d, int s, void *da, void *sa, size_t si));
|
||||||
_PROTOTYPE( int vm_unmap, (int endpt, void *addr));
|
_PROTOTYPE( int vm_unmap, (endpoint_t endpt, void *addr));
|
||||||
_PROTOTYPE( unsigned long vm_getphys, (int endpt, void *addr));
|
_PROTOTYPE( unsigned long vm_getphys, (endpoint_t endpt, void *addr));
|
||||||
_PROTOTYPE( u8_t vm_getrefcount, (int endpt, void *addr));
|
_PROTOTYPE( u8_t vm_getrefcount, (int endpt, void *addr));
|
||||||
|
|
||||||
#endif /* _MMAN_H */
|
#endif /* _MMAN_H */
|
||||||
|
@ -270,7 +270,7 @@ PRIVATE int lapic_enable_in_msr(void)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
PUBLIC int lapic_enable(void)
|
PRIVATE int lapic_enable(void)
|
||||||
{
|
{
|
||||||
u32_t val, nlvt;
|
u32_t val, nlvt;
|
||||||
unsigned cpu = cpuid;
|
unsigned cpu = cpuid;
|
||||||
|
@ -111,8 +111,6 @@ _PROTOTYPE (void ioapic_write, (u32_t addr, u32_t offset, u32_t data));
|
|||||||
_PROTOTYPE (void lapic_eoi, (void));
|
_PROTOTYPE (void lapic_eoi, (void));
|
||||||
*/
|
*/
|
||||||
|
|
||||||
_PROTOTYPE (int lapic_enable, (void));
|
|
||||||
|
|
||||||
_PROTOTYPE(int apic_single_cpu_init, (void));
|
_PROTOTYPE(int apic_single_cpu_init, (void));
|
||||||
|
|
||||||
_PROTOTYPE(void lapic_set_timer_periodic, (unsigned freq));
|
_PROTOTYPE(void lapic_set_timer_periodic, (unsigned freq));
|
||||||
|
@ -50,11 +50,9 @@
|
|||||||
* array size will be negative and this won't compile.
|
* array size will be negative and this won't compile.
|
||||||
*/
|
*/
|
||||||
PRIVATE int (*call_vec[NR_SYS_CALLS])(struct proc * caller, message *m_ptr);
|
PRIVATE int (*call_vec[NR_SYS_CALLS])(struct proc * caller, message *m_ptr);
|
||||||
PRIVATE char *callnames[NR_SYS_CALLS];
|
|
||||||
|
|
||||||
#define map(call_nr, handler) \
|
#define map(call_nr, handler) \
|
||||||
{extern int dummy[NR_SYS_CALLS>(unsigned)(call_nr-KERNEL_CALL) ? 1:-1];} \
|
{extern int dummy[NR_SYS_CALLS>(unsigned)(call_nr-KERNEL_CALL) ? 1:-1];} \
|
||||||
callnames[(call_nr-KERNEL_CALL)] = #call_nr; \
|
|
||||||
call_vec[(call_nr-KERNEL_CALL)] = (handler)
|
call_vec[(call_nr-KERNEL_CALL)] = (handler)
|
||||||
|
|
||||||
PRIVATE void kernel_call_finish(struct proc * caller, message *msg, int result)
|
PRIVATE void kernel_call_finish(struct proc * caller, message *msg, int result)
|
||||||
@ -177,7 +175,6 @@ PUBLIC void system_init(void)
|
|||||||
*/
|
*/
|
||||||
for (i=0; i<NR_SYS_CALLS; i++) {
|
for (i=0; i<NR_SYS_CALLS; i++) {
|
||||||
call_vec[i] = NULL;
|
call_vec[i] = NULL;
|
||||||
callnames[i] = "unused";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process management. */
|
/* Process management. */
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
#include "kernel/system.h"
|
#include "kernel/system.h"
|
||||||
|
|
||||||
#include <minix/endpoint.h>
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#if USE_EXIT
|
#if USE_EXIT
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
#include "kernel/system.h"
|
#include "kernel/system.h"
|
||||||
#include <signal.h>
|
|
||||||
#include <sys/sigcontext.h>
|
|
||||||
#include <minix/endpoint.h>
|
#include <minix/endpoint.h>
|
||||||
|
|
||||||
/*===========================================================================*
|
/*===========================================================================*
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
#include "kernel/system.h"
|
#include "kernel/system.h"
|
||||||
#include <signal.h>
|
|
||||||
#include <sys/sigcontext.h>
|
|
||||||
#include <minix/endpoint.h>
|
#include <minix/endpoint.h>
|
||||||
#include "kernel/clock.h"
|
#include "kernel/clock.h"
|
||||||
|
|
||||||
|
@ -58,14 +58,13 @@ PUBLIC int do_setalarm(struct proc * caller, message * m_ptr)
|
|||||||
/*===========================================================================*
|
/*===========================================================================*
|
||||||
* cause_alarm *
|
* cause_alarm *
|
||||||
*===========================================================================*/
|
*===========================================================================*/
|
||||||
PRIVATE void cause_alarm(tp)
|
PRIVATE void cause_alarm(timer_t *tp)
|
||||||
timer_t *tp;
|
|
||||||
{
|
{
|
||||||
/* Routine called if a timer goes off and the process requested a synchronous
|
/* Routine called if a timer goes off and the process requested a synchronous
|
||||||
* alarm. The process number is stored in timer argument 'ta_int'. Notify that
|
* alarm. The process number is stored in timer argument 'ta_int'. Notify that
|
||||||
* process with a notification message from CLOCK.
|
* process with a notification message from CLOCK.
|
||||||
*/
|
*/
|
||||||
int proc_nr_e = tmr_arg(tp)->ta_int; /* get process number */
|
endpoint_t proc_nr_e = tmr_arg(tp)->ta_int; /* get process number */
|
||||||
mini_notify(proc_addr(CLOCK), proc_nr_e); /* notify process */
|
mini_notify(proc_addr(CLOCK), proc_nr_e); /* notify process */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,8 +21,9 @@
|
|||||||
PUBLIC int do_times(struct proc * caller, message * m_ptr)
|
PUBLIC int do_times(struct proc * caller, message * m_ptr)
|
||||||
{
|
{
|
||||||
/* Handle sys_times(). Retrieve the accounting information. */
|
/* Handle sys_times(). Retrieve the accounting information. */
|
||||||
register struct proc *rp;
|
register const struct proc *rp;
|
||||||
int proc_nr, e_proc_nr;
|
int proc_nr;
|
||||||
|
endpoint_t e_proc_nr;
|
||||||
|
|
||||||
/* Insert the times needed by the SYS_TIMES kernel call in the message.
|
/* Insert the times needed by the SYS_TIMES kernel call in the message.
|
||||||
* The clock's interrupt handler may run to update the user or system time
|
* The clock's interrupt handler may run to update the user or system time
|
||||||
|
@ -16,9 +16,9 @@
|
|||||||
|
|
||||||
/* Buffer for SYS_VDEVIO to copy (port,value)-pairs from/ to user. */
|
/* Buffer for SYS_VDEVIO to copy (port,value)-pairs from/ to user. */
|
||||||
PRIVATE char vdevio_buf[VDEVIO_BUF_SIZE];
|
PRIVATE char vdevio_buf[VDEVIO_BUF_SIZE];
|
||||||
PRIVATE pvb_pair_t *pvb = (pvb_pair_t *) vdevio_buf;
|
PRIVATE pvb_pair_t * const pvb = (pvb_pair_t *) vdevio_buf;
|
||||||
PRIVATE pvw_pair_t *pvw = (pvw_pair_t *) vdevio_buf;
|
PRIVATE pvw_pair_t * const pvw = (pvw_pair_t *) vdevio_buf;
|
||||||
PRIVATE pvl_pair_t *pvl = (pvl_pair_t *) vdevio_buf;
|
PRIVATE pvl_pair_t * const pvl = (pvl_pair_t *) vdevio_buf;
|
||||||
|
|
||||||
/*===========================================================================*
|
/*===========================================================================*
|
||||||
* do_vdevio *
|
* do_vdevio *
|
||||||
|
@ -60,7 +60,8 @@ int c; /* character to append */
|
|||||||
kmess.km_size += 1;
|
kmess.km_size += 1;
|
||||||
kmess.km_next = (kmess.km_next + 1) % _KMESS_BUF_SIZE;
|
kmess.km_next = (kmess.km_next + 1) % _KMESS_BUF_SIZE;
|
||||||
} else {
|
} else {
|
||||||
int p, outprocs[] = OUTPUT_PROCS_ARRAY;
|
int p;
|
||||||
|
endpoint_t outprocs[] = OUTPUT_PROCS_ARRAY;
|
||||||
if(!(minix_panicing || do_serial_debug)) {
|
if(!(minix_panicing || do_serial_debug)) {
|
||||||
for(p = 0; outprocs[p] != NONE; p++) {
|
for(p = 0; outprocs[p] != NONE; p++) {
|
||||||
if(isokprocn(outprocs[p]) && !isemptyn(outprocs[p])) {
|
if(isokprocn(outprocs[p]) && !isemptyn(outprocs[p])) {
|
||||||
|
@ -232,7 +232,7 @@ _PROTOTYPE( unsigned conv2, (int norm, int w) );
|
|||||||
_PROTOTYPE( long conv4, (int norm, long x) );
|
_PROTOTYPE( long conv4, (int norm, long x) );
|
||||||
_PROTOTYPE( int fetch_name, (char *path, int len, int flag) );
|
_PROTOTYPE( int fetch_name, (char *path, int len, int flag) );
|
||||||
_PROTOTYPE( int no_sys, (void) );
|
_PROTOTYPE( int no_sys, (void) );
|
||||||
_PROTOTYPE( int isokendpt_f, (char *f, int l, int e, int *p, int ft));
|
_PROTOTYPE( int isokendpt_f, (char *f, int l, endpoint_t e, int *p, int ft));
|
||||||
|
|
||||||
#define okendpt(e, p) isokendpt_f(__FILE__, __LINE__, (e), (p), 1)
|
#define okendpt(e, p) isokendpt_f(__FILE__, __LINE__, (e), (p), 1)
|
||||||
#define isokendpt(e, p) isokendpt_f(__FILE__, __LINE__, (e), (p), 0)
|
#define isokendpt(e, p) isokendpt_f(__FILE__, __LINE__, (e), (p), 0)
|
||||||
|
@ -86,7 +86,7 @@ PUBLIC int no_sys()
|
|||||||
/*===========================================================================*
|
/*===========================================================================*
|
||||||
* isokendpt_f *
|
* isokendpt_f *
|
||||||
*===========================================================================*/
|
*===========================================================================*/
|
||||||
PUBLIC int isokendpt_f(char *file, int line, int endpoint, int *proc, int fatal)
|
PUBLIC int isokendpt_f(char *file, int line, endpoint_t endpoint, int *proc, int fatal)
|
||||||
{
|
{
|
||||||
int failed = 0;
|
int failed = 0;
|
||||||
endpoint_t ke;
|
endpoint_t ke;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user