More const correctness.
Other code cleanup.
_PROTOTYPE( int munmap, (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( int vm_unmap, (int endpt, void *addr));
-_PROTOTYPE( unsigned long vm_getphys, (int endpt, void *addr));
+_PROTOTYPE( int vm_unmap, (endpoint_t endpt, void *addr));
+_PROTOTYPE( unsigned long vm_getphys, (endpoint_t endpt, void *addr));
_PROTOTYPE( u8_t vm_getrefcount, (int endpt, void *addr));
#endif /* _MMAN_H */
return 1;
}
-PUBLIC int lapic_enable(void)
+PRIVATE int lapic_enable(void)
{
u32_t val, nlvt;
unsigned cpu = cpuid;
_PROTOTYPE (void lapic_eoi, (void));
*/
-_PROTOTYPE (int lapic_enable, (void));
-
_PROTOTYPE(int apic_single_cpu_init, (void));
_PROTOTYPE(void lapic_set_timer_periodic, (unsigned freq));
* array size will be negative and this won't compile.
*/
PRIVATE int (*call_vec[NR_SYS_CALLS])(struct proc * caller, message *m_ptr);
-PRIVATE char *callnames[NR_SYS_CALLS];
#define map(call_nr, handler) \
{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)
PRIVATE void kernel_call_finish(struct proc * caller, message *msg, int result)
*/
for (i=0; i<NR_SYS_CALLS; i++) {
call_vec[i] = NULL;
- callnames[i] = "unused";
}
/* Process management. */
#include "kernel/system.h"
-#include <minix/endpoint.h>
#include <signal.h>
#if USE_EXIT
#include "kernel/system.h"
-#include <signal.h>
-#include <sys/sigcontext.h>
#include <minix/endpoint.h>
/*===========================================================================*
#include "kernel/system.h"
-#include <signal.h>
-#include <sys/sigcontext.h>
#include <minix/endpoint.h>
#include "kernel/clock.h"
/*===========================================================================*
* cause_alarm *
*===========================================================================*/
-PRIVATE void cause_alarm(tp)
-timer_t *tp;
+PRIVATE void cause_alarm(timer_t *tp)
{
/* 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
* 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 */
}
PUBLIC int do_times(struct proc * caller, message * m_ptr)
{
/* Handle sys_times(). Retrieve the accounting information. */
- register struct proc *rp;
- int proc_nr, e_proc_nr;
+ register const struct proc *rp;
+ int proc_nr;
+ endpoint_t e_proc_nr;
/* 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
/* Buffer for SYS_VDEVIO to copy (port,value)-pairs from/ to user. */
PRIVATE char vdevio_buf[VDEVIO_BUF_SIZE];
-PRIVATE pvb_pair_t *pvb = (pvb_pair_t *) vdevio_buf;
-PRIVATE pvw_pair_t *pvw = (pvw_pair_t *) vdevio_buf;
-PRIVATE pvl_pair_t *pvl = (pvl_pair_t *) vdevio_buf;
+PRIVATE pvb_pair_t * const pvb = (pvb_pair_t *) vdevio_buf;
+PRIVATE pvw_pair_t * const pvw = (pvw_pair_t *) vdevio_buf;
+PRIVATE pvl_pair_t * const pvl = (pvl_pair_t *) vdevio_buf;
/*===========================================================================*
* do_vdevio *
kmess.km_size += 1;
kmess.km_next = (kmess.km_next + 1) % _KMESS_BUF_SIZE;
} else {
- int p, outprocs[] = OUTPUT_PROCS_ARRAY;
+ int p;
+ endpoint_t outprocs[] = OUTPUT_PROCS_ARRAY;
if(!(minix_panicing || do_serial_debug)) {
for(p = 0; outprocs[p] != NONE; p++) {
if(isokprocn(outprocs[p]) && !isemptyn(outprocs[p])) {
_PROTOTYPE( long conv4, (int norm, long x) );
_PROTOTYPE( int fetch_name, (char *path, int len, int flag) );
_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 isokendpt(e, p) isokendpt_f(__FILE__, __LINE__, (e), (p), 0)
/*===========================================================================*
* 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;
endpoint_t ke;