Made some functions PRIVATE, including ones that aren't used anywhere.
typedef int irq_hook_t;
-/* Translate a pointer to a field in a structure to a pointer to the structure
- * itself. So it translates '&struct_ptr->field' back to 'struct_ptr'.
- */
-#define structof(type, field, ptr) \
- ((type *) (((char *) (ptr)) - offsetof(type, field)))
-
static timer_t *fxp_timers= NULL;
static clock_t fxp_next_timeout= 0;
/*===========================================================================*
* read_8235A_timer *
*===========================================================================*/
-PUBLIC clock_t read_8253A_timer(void)
+PRIVATE clock_t read_8253A_timer(void)
{
/* Read the counter of channel 0 of the 8253A timer. This counter
* counts down at a rate of TIMER_FREQ and restarts at
_PROTOTYPE(int init_8253A_timer, (unsigned freq));
_PROTOTYPE(void stop_8253A_timer, (void));
-_PROTOTYPE(clock_t read_8253A_timer, (void));
#endif /* __CLOCK_X86_H__ */
}
/* Disable 8259 - write 0xFF in OCW1 master and slave. */
-PUBLIC void i8259_disable(void)
+PRIVATE void i8259_disable(void)
{
outb(INT2_CTLMASK, 0xFF);
outb(INT_CTLMASK, 0xFF);
#define NOPDE (-1)
#define PDEMASK(n) (1L << (n))
-PUBLIC u32_t dirtypde;
+PUBLIC u32_t dirtypde; /* Accessed from assembly code. */
#define WANT_FREEPDES (sizeof(dirtypde)*8-5)
PRIVATE int nfreepdes = 0, freepdes[WANT_FREEPDES], inusepde = NOPDE;
/*===========================================================================*
* lin_lin_copy *
*===========================================================================*/
-int lin_lin_copy(struct proc *srcproc, vir_bytes srclinaddr,
+PRIVATE int lin_lin_copy(struct proc *srcproc, vir_bytes srclinaddr,
struct proc *dstproc, vir_bytes dstlinaddr, vir_bytes bytes)
{
u32_t addr;
if(u) { unlock; }
}
-char *cr0_str(u32_t e)
+PRIVATE char *cr0_str(u32_t e)
{
static char str[80];
strcpy(str, "");
return str;
}
-char *cr4_str(u32_t e)
+PRIVATE char *cr4_str(u32_t e)
{
static char str[80];
strcpy(str, "");
/*===========================================================================*
* vm_suspend *
*===========================================================================*/
-PUBLIC int vm_suspend(struct proc *caller, struct proc *target,
+PRIVATE int vm_suspend(struct proc *caller, struct proc *target,
vir_bytes linaddr, vir_bytes len, int wrflag, int type)
{
/* This range is not OK for this process. Set parameters
NOREC_RETURN(deliver, r);
}
-char *flagstr(u32_t e, int dir)
+PRIVATE char *flagstr(u32_t e, int dir)
{
static char str[80];
strcpy(str, "");
return str;
}
-void vm_pt_print(u32_t *pagetable, u32_t v)
+PRIVATE void vm_pt_print(u32_t *pagetable, u32_t v)
{
int pte;
int col = 0;
return;
}
-void vm_print(u32_t *root)
+PRIVATE void vm_print(u32_t *root)
{
int pde;
/*===========================================================================*
* phys2seg *
*===========================================================================*/
-PUBLIC void phys2seg(u16_t *seg, vir_bytes *off, phys_bytes phys)
+PRIVATE void phys2seg(u16_t *seg, vir_bytes *off, phys_bytes phys)
{
/* Return a segment selector and offset that can be used to reach a physical
* address, for use by a driver doing memory I/O in the A0000 - DFFFF range.
*/
*seg = FLAT_DS_SELECTOR;
- *off = phys;
+ *off = (vir_bytes) phys;
}
/*===========================================================================*
/*===========================================================================*
* init_codeseg *
*===========================================================================*/
-PUBLIC void init_codeseg(register struct segdesc_s *segdp, phys_bytes base,
+PRIVATE void init_codeseg(register struct segdesc_s *segdp, phys_bytes base,
vir_bytes size, int privilege)
{
/* Build descriptor for a code segment. */
/*===========================================================================*
* check_segments *
*===========================================================================*/
-PUBLIC void check_segments(char *File, int line)
+PRIVATE void check_segments(char *File, int line)
{
int checked = 0;
int fail = 0;
EXTERN struct tss_s tss;
_PROTOTYPE( void idt_init, (void) );
-_PROTOTYPE( void init_codeseg, (struct segdesc_s *segdp, phys_bytes base,
- vir_bytes size, int privilege) );
_PROTOTYPE( void init_dataseg, (struct segdesc_s *segdp, phys_bytes base,
vir_bytes size, int privilege) );
_PROTOTYPE( void enable_iop, (struct proc *pp) );
_PROTOTYPE(void idt_reload,(void));
EXTERN void * k_boot_stktop;
-_PROTOTYPE(void tss_init, (struct tss_s * tss, void * kernel_stack, unsigned cpu));
_PROTOTYPE( void int_gate, (unsigned vec_nr, vir_bytes offset,
unsigned dpl_type) );
-_PROTOTYPE(void i8259_disable, (void));
/* functions defined in architecture-independent kernel source. */
#include "../../proto.h"
phys_copy(aout + i * A_MINHDR, vir2phys(h), (phys_bytes) A_MINHDR);
}
-PUBLIC void tss_init(struct tss_s * tss, void * kernel_stack, unsigned cpu)
+PRIVATE void tss_init(struct tss_s * tss, void * kernel_stack, unsigned cpu)
{
/*
* make space for process pointer and cpu id and point to the first
#define COLOR_BASE 0xB8000L
-PUBLIC void cons_setc(int pos, int c)
+PRIVATE void cons_setc(int pos, int c)
{
char ch;
phys_copy(vir2phys((vir_bytes)&ch), COLOR_BASE+(20*80+pos)*2, 1);
}
-PUBLIC void cons_seth(int pos, int n)
+PRIVATE void cons_seth(int pos, int n)
{
n &= 0xf;
if (n < 10)
}
/*
- * Timer interupt handler. This is the only think executed on non boot
+ * Timer interupt handler. This is the only thing executed on non boot
* processors. It is called by bsp_timer_int_handler() on the boot processor
*/
PUBLIC int ap_timer_int_handler(void)
/* How many bytes for the kernel stack. Space allocated in mpx.s. */
#define K_STACK_BYTES 1024
-#define K_PARAM_SIZE 512
-
#endif /* CONFIG_H */
#include "config.h"
#include "debug.h"
-/* Translate a pointer to a field in a structure to a pointer to the structure
- * itself. So it translates '&struct_ptr->field' back to 'struct_ptr'.
- */
-#define structof(type, field, ptr) \
- ((type *) (((char *) (ptr)) - offsetof(type, field)))
-
/* Translate an endpoint number to a process number, return success. */
#define isokendpt(e,p) isokendpt_d((e),(p),0)
#define okendpt(e,p) isokendpt_d((e),(p),1)
#include "config.h"
#include "debug.h"
-/* Variables relating to shutting down MINIX. */
-EXTERN char kernel_exception; /* TRUE after system exceptions */
-EXTERN char shutdown_started; /* TRUE after shutdowns / reboots */
-
/* Kernel information structures. This groups vital kernel information. */
EXTERN struct kinfo kinfo; /* kernel information for users */
EXTERN struct machine machine; /* machine information for users */
#define iskerneln(n) ((n) < 0)
#define isuserp(p) isusern((p) >= BEG_USER_ADDR)
#define isusern(n) ((n) >= 0)
-#define isrootsysp(p) isrootsysn((p)->p_nr)
#define isrootsysn(n) ((n) == ROOT_SYS_PROC_NR)
#ifndef __ASSEMBLY__
_PROTOTYPE( void rm_irq_handler, (irq_hook_t *hook) );
_PROTOTYPE( void enable_irq, (irq_hook_t *hook) );
_PROTOTYPE( int disable_irq, (irq_hook_t *hook) );
-_PROTOTYPE( void cons_setc, (int pos, int c) );
-_PROTOTYPE( void cons_seth, (int pos, int n) );
/* debug.c */
#if DEBUG_SCHED_CHECK
endpoint_t to, vir_bytes to_addr, size_t bytes));
_PROTOTYPE( int data_copy_vmcheck, (endpoint_t from, vir_bytes from_addr,
endpoint_t to, vir_bytes to_addr, size_t bytes));
-#define data_copy_to(d, p, v, n) data_copy(SYSTEM, (d), (p), (v), (n));
-#define data_copy_from(d, p, v, n) data_copy((p), (v), SYSTEM, (d), (n));
_PROTOTYPE( void alloc_segments, (struct proc *rp) );
_PROTOTYPE( void vm_init, (struct proc *first) );
-_PROTOTYPE( int vm_copy, (vir_bytes src, struct proc *srcproc,
- vir_bytes dst, struct proc *dstproc, phys_bytes bytes));
_PROTOTYPE( phys_bytes umap_local, (register struct proc *rp, int seg,
vir_bytes vir_addr, vir_bytes bytes));
_PROTOTYPE( void cp_mess, (int src,phys_clicks src_clicks,
_PROTOTYPE( int vm_contiguous, (struct proc *targetproc, u32_t vir_buf, size_t count));
_PROTOTYPE( void proc_stacktrace, (struct proc *proc) );
_PROTOTYPE( int vm_lookup, (struct proc *proc, vir_bytes virtual, vir_bytes *result, u32_t *ptent));
-_PROTOTYPE( int vm_suspend, (struct proc *caller, struct proc *target,
- phys_bytes lin, phys_bytes size, int wrflag, int type));
_PROTOTYPE( int delivermsg, (struct proc *target));
_PROTOTYPE( void arch_do_syscall, (struct proc *proc) );
_PROTOTYPE( int arch_phys_map, (int index, phys_bytes *addr,