/*===========================================================================*
* arch_do_vmctl *
*===========================================================================*/
-int arch_do_vmctl(m_ptr, p)
-register message *m_ptr; /* pointer to request message */
-struct proc *p;
+int arch_do_vmctl(
+ register message *m_ptr, /* pointer to request message */
+ struct proc *p
+)
{
switch(m_ptr->SVMCTL_PARAM) {
case VMCTL_GET_PDBR:
/*===========================================================================*
* do_ser_debug *
*===========================================================================*/
-void do_ser_debug()
+void do_ser_debug(void)
{
}
#define _BSP_INIT_H_
/* BSP init */
-void bsp_init();
+void bsp_init(void);
#endif /* __BSP_INIT_H__ */
#ifndef _BSP_SERIAL_H_
#define _BSP_SERIAL_H_
-void bsp_ser_init();
+void bsp_ser_init(void);
void bsp_ser_putc(char c);
+
#endif /* _BSP_SERIAL_H_ */
#include "bsp_reset.h"
void
-bsp_init()
+bsp_init(void)
{
+
/* map memory for padconf */
bsp_padconf_init();
* in high memory so keep in mind there are two copies of this code in the kernel.
*/
void
-bsp_ser_init()
+bsp_ser_init(void)
{
if (BOARD_IS_BBXM(machine.board_id)) {
omap_serial.base = OMAP3_DM37XX_DEBUG_UART_BASE;
#ifndef __ASSEMBLY__
-void omap3_ser_init();
+void omap3_ser_init(void);
void omap3_ser_putc(char c);
#endif /* __ASSEMBLY__ */
}
void
-omap3_frclock_stop()
+omap3_frclock_stop(void)
{
mmio_clear(fr_timer->base + fr_timer->regs->TCLR, OMAP3_TCLR_ST);
}
}
void
-bsp_timer_stop()
+bsp_timer_stop(void)
{
mmio_clear(timer->base + timer->regs->TCLR, OMAP3_TCLR_ST);
}
}
void
-bsp_timer_int_handler()
+bsp_timer_int_handler(void)
{
/* Clear all interrupts */
u32_t tisr, now;
void hw_intr_ack(int irq){};
void hw_intr_used(int irq){};
void hw_intr_not_used(int irq){};
-void hw_intr_disable_all(){};
+void hw_intr_disable_all(void){};
int vm_flags, kern_phys_map * priv,
vir_bytes ptr);
-void arch_ser_init();
+void arch_ser_init(void);
/* functions defined in architecture-independent kernel source. */
#include "kernel/proto.h"
/* Read CLIDR, Cache Level ID Register */
-static inline u32_t read_clidr(){
+static inline u32_t read_clidr(void){
u32_t clidr;
asm volatile("mrc p15, 1, %[clidr], c0, c0 , 1 @ READ CLIDR\n\t"
: [clidr] "=r" (clidr));
/* Read CSSELR, Cache Size Selection Register */
-static inline u32_t read_csselr(){
+static inline u32_t read_csselr(void){
u32_t csselr;
asm volatile("mrc p15, 2, %[csselr], c0, c0 , 0 @ READ CSSELR\n\t"
: [csselr] "=r" (csselr));
}
/* Read Cache Size ID Register */
-static inline u32_t read_ccsidr()
+static inline u32_t read_ccsidr(void)
{
u32_t ccsidr;
asm volatile("mrc p15, 1, %[ccsidr], c0, c0, 0 @ Read CCSIDR\n\t"
}
/* Read TLBTR, TLB Type Register */
-static inline u32_t read_tlbtr()
+static inline u32_t read_tlbtr(void)
{
u32_t tlbtr;
asm volatile("mrc p15, 0, %[tlbtr], c0, c0, 3 @ Read TLBTR\n\t"
isb();
}
-static inline void dcache_clean(){
+static inline void dcache_clean(void){
dcache_maint(1);
}
-static inline void dcache_invalidate (){
+static inline void dcache_invalidate(void){
dcache_maint(2);
}
/* Read System Control Register */
-static inline u32_t read_sctlr()
+static inline u32_t read_sctlr(void)
{
u32_t ctl;
}
/* Read Translation Table Base Register 0 */
-static inline u32_t read_ttbr0()
+static inline u32_t read_ttbr0(void)
{
u32_t bar;
}
/* Read Translation Table Base Register 1 */
-static inline u32_t read_ttbr1()
+static inline u32_t read_ttbr1(void)
{
u32_t bar;
}
/* Read Translation Table Base Control Register */
-static inline u32_t read_ttbcr()
+static inline u32_t read_ttbcr(void)
{
u32_t bcr;
}
/* Read Domain Access Control Register */
-static inline u32_t read_dacr()
+static inline u32_t read_dacr(void)
{
u32_t dacr;
}
/* Read Data Fault Status Register */
-static inline u32_t read_dfsr()
+static inline u32_t read_dfsr(void)
{
u32_t fsr;
}
/* Read Instruction Fault Status Register */
-static inline u32_t read_ifsr()
+static inline u32_t read_ifsr(void)
{
u32_t fsr;
}
/* Read Data Fault Address Register */
-static inline u32_t read_dfar()
+static inline u32_t read_dfar(void)
{
u32_t far;
}
/* Read Instruction Fault Address Register */
-static inline u32_t read_ifar()
+static inline u32_t read_ifar(void)
{
u32_t far;
}
/* Read Vector Base Address Register */
-static inline u32_t read_vbar()
+static inline u32_t read_vbar(void)
{
u32_t vbar;
}
/* Read the Main ID Register */
-static inline u32_t read_midr()
+static inline u32_t read_midr(void)
{
u32_t id;
}
/* Read Auxiliary Control Register */
-static inline u32_t read_actlr()
+static inline u32_t read_actlr(void)
{
u32_t ctl;
}
/* Read Current Program Status Register */
-static inline u32_t read_cpsr()
+static inline u32_t read_cpsr(void)
{
u32_t status;
void hw_intr_ack(int irq);
void hw_intr_used(int irq);
void hw_intr_not_used(int irq);
-void hw_intr_disable_all();
+void hw_intr_disable_all(void);
#endif /* __HW_INTR_ARM_H__ */
/*===========================================================================*
* umap_virtual *
*===========================================================================*/
-phys_bytes umap_virtual(rp, seg, vir_addr, bytes)
-register struct proc *rp; /* pointer to proc table entry for process */
-int seg; /* T, D, or S segment */
-vir_bytes vir_addr; /* virtual address in bytes within the seg */
-vir_bytes bytes; /* # of bytes to be copied */
+phys_bytes umap_virtual(
+ register struct proc *rp, /* pointer to proc table entry for process */
+ int seg, /* T, D, or S segment */
+ vir_bytes vir_addr, /* virtual address in bytes within the seg */
+ vir_bytes bytes /* # of bytes to be copied */
+)
{
phys_bytes phys = 0;
/*===========================================================================*
* virtual_copy_f *
*===========================================================================*/
-int virtual_copy_f(caller, src_addr, dst_addr, bytes, vmcheck)
-struct proc * caller;
-struct vir_addr *src_addr; /* source virtual address */
-struct vir_addr *dst_addr; /* destination virtual address */
-vir_bytes bytes; /* # of bytes to copy */
-int vmcheck; /* if nonzero, can return VMSUSPEND */
+int virtual_copy_f(
+ struct proc * caller,
+ struct vir_addr *src_addr, /* source virtual address */
+ struct vir_addr *dst_addr, /* destination virtual address */
+ vir_bytes bytes, /* # of bytes to copy */
+ int vmcheck /* if nonzero, can return VMSUSPEND */
+)
{
/* Copy bytes from virtual address src_addr to virtual address dst_addr. */
struct vir_addr *vir_addr[2]; /* virtual source and destination address */
write_sctlr(sctlr);
}
-phys_bytes pg_load()
+phys_bytes pg_load(void)
{
phys_bytes phpagedir = vir2phys(pagedir);
write_ttbr0(phpagedir);
int booting_cpu = 0;
-void prot_init()
+void prot_init(void)
{
/* tell the HW where we stored our vector table */
write_vbar((reg_t)&exc_vector_table);
/*===========================================================================*
* arch_do_vmctl *
*===========================================================================*/
-int arch_do_vmctl(m_ptr, p)
-register message *m_ptr; /* pointer to request message */
-struct proc *p;
+int arch_do_vmctl(
+ register message *m_ptr, /* pointer to request message */
+ struct proc *p
+)
{
switch(m_ptr->SVMCTL_PARAM) {
case VMCTL_GET_PDBR:
/*===========================================================================*
* do_ser_debug *
*===========================================================================*/
-void do_ser_debug()
+void do_ser_debug(void)
{
u8_t c, lsr;
#if DEBUG_SERIAL
-static void ser_dump_vfs()
+static void ser_dump_vfs(void)
{
/* Notify VFS it has to generate stack traces. Kernel can't do that as
* it's not aware of user space threads.
/*===========================================================================*
* umap_virtual *
*===========================================================================*/
-phys_bytes umap_virtual(rp, seg, vir_addr, bytes)
-register struct proc *rp; /* pointer to proc table entry for process */
-int seg; /* T, D, or S segment */
-vir_bytes vir_addr; /* virtual address in bytes within the seg */
-vir_bytes bytes; /* # of bytes to be copied */
+phys_bytes umap_virtual(
+ register struct proc *rp, /* pointer to proc table entry for process */
+ int seg, /* T, D, or S segment */
+ vir_bytes vir_addr, /* virtual address in bytes within the seg */
+ vir_bytes bytes /* # of bytes to be copied */
+)
{
phys_bytes phys = 0;
/*===========================================================================*
* virtual_copy_f *
*===========================================================================*/
-int virtual_copy_f(caller, src_addr, dst_addr, bytes, vmcheck)
-struct proc * caller;
-struct vir_addr *src_addr; /* source virtual address */
-struct vir_addr *dst_addr; /* destination virtual address */
-vir_bytes bytes; /* # of bytes to copy */
-int vmcheck; /* if nonzero, can return VMSUSPEND */
+int virtual_copy_f(
+ struct proc * caller,
+ struct vir_addr *src_addr, /* source virtual address */
+ struct vir_addr *dst_addr, /* destination virtual address */
+ vir_bytes bytes, /* # of bytes to copy */
+ int vmcheck /* if nonzero, can return VMSUSPEND */
+)
{
/* Copy bytes from virtual address src_addr to virtual address dst_addr. */
struct vir_addr *vir_addr[2]; /* virtual source and destination address */
write_cr4(cr4);
}
-phys_bytes pg_load()
+phys_bytes pg_load(void)
{
phys_bytes phpagedir = vir2phys(pagedir);
write_cr3(phpagedir);
/*===========================================================================*
* prot_init *
*===========================================================================*/
-void prot_init()
+void prot_init(void)
{
extern char k_boot_stktop;
/*===========================================================================*
* set_kernel_timer *
*===========================================================================*/
-void set_kernel_timer(tp, exp_time, watchdog)
-minix_timer_t *tp; /* pointer to timer structure */
-clock_t exp_time; /* expiration monotonic time */
-tmr_func_t watchdog; /* watchdog to be called */
+void set_kernel_timer(
+ minix_timer_t *tp, /* pointer to timer structure */
+ clock_t exp_time, /* expiration monotonic time */
+ tmr_func_t watchdog /* watchdog to be called */
+)
{
/* Insert the new timer in the active timers list. Always update the
* next timeout time by setting it to the front of the active list.
/*===========================================================================*
* reset_kernel_timer *
*===========================================================================*/
-void reset_kernel_timer(tp)
-minix_timer_t *tp; /* pointer to timer structure */
+void reset_kernel_timer(
+ minix_timer_t *tp /* pointer to timer structure */
+)
{
/* The timer pointed to by 'tp' is no longer needed. Remove it from both the
* active and expired lists. Always update the next timeout time by setting
/*===========================================================================*
* cstart *
*===========================================================================*/
-void cstart()
+void cstart(void)
{
/* Perform system initializations prior to calling main(). Most settings are
* determined with help of the environment strings passed by MINIX' loader.
/*===========================================================================*
* deadlock *
*===========================================================================*/
-static int deadlock(function, cp, src_dst_e)
-int function; /* trap number */
-register struct proc *cp; /* pointer to caller */
-endpoint_t src_dst_e; /* src or dst process */
+static int deadlock(
+ int function, /* trap number */
+ register struct proc *cp, /* pointer to caller */
+ endpoint_t src_dst_e /* src or dst process */
+)
{
/* Check for deadlock. This can happen if 'caller_ptr' and 'src_dst' have
* a cyclic dependency of blocking send and receive calls. The only cyclic
/*===========================================================================*
* try_async *
*===========================================================================*/
-static int try_async(caller_ptr)
-struct proc *caller_ptr;
+static int try_async(struct proc * caller_ptr)
{
int r;
struct priv *privp;
* isokendpt_f *
*===========================================================================*/
#if DEBUG_ENABLE_IPC_WARNINGS
-int isokendpt_f(file, line, e, p, fatalflag)
-const char *file;
-int line;
+int isokendpt_f(const char * file, int line, endpoint_t e, int * p,
+ const int fatalflag)
#else
-int isokendpt_f(e, p, fatalflag)
+int isokendpt_f(endpoint_t e, int * p, const int fatalflag)
#endif
-endpoint_t e;
-int *p;
-const int fatalflag;
{
int ok = 0;
/* Convert an endpoint number into a process number.
*fpu_owner_ptr = NULL;
}
-void ser_dump_proc()
+void ser_dump_proc(void)
{
struct proc *pp;
/*===========================================================================*
* profile_clock_stop *
*===========================================================================*/
-void stop_profile_clock()
+void stop_profile_clock(void)
{
arch_stop_profile_clock();
size);
/* start.c */
-void cstart();
+void cstart(void);
char *env_get(const char *key);
/* system.c */
#endif
/* functions defined in architecture-dependent files. */
-void prot_init();
-void arch_post_init();
+void prot_init(void);
+void arch_post_init(void);
void arch_set_secondary_ipc_return(struct proc *, u32_t val);
phys_bytes phys_copy(phys_bytes source, phys_bytes dest, phys_bytes
count);
/*===========================================================================*
* get_priv *
*===========================================================================*/
-int get_priv(rc, priv_id)
-register struct proc *rc; /* new (child) process pointer */
-int priv_id; /* privilege id */
+int get_priv(
+ register struct proc *rc, /* new (child) process pointer */
+ int priv_id /* privilege id */
+)
{
/* Allocate a new privilege structure for a system process. Privilege ids
* can be assigned either statically or dynamically.
/*===========================================================================*
* cause_sig *
*===========================================================================*/
-void cause_sig(proc_nr, sig_nr)
-proc_nr_t proc_nr; /* process to be signalled */
-int sig_nr; /* signal to be sent */
+void cause_sig(proc_nr_t proc_nr, int sig_nr)
{
-/* A system process wants to send a signal to a process. Examples are:
+/* A system process wants to send signal 'sig_nr' to process 'proc_nr'.
+ * Examples are:
* - HARDWARE wanting to cause a SIGSEGV after a CPU exception
* - TTY wanting to cause SIGINT upon getting a DEL
* - FS wanting to cause SIGPIPE for a broken pipe
/*===========================================================================*
* clear_endpoint *
*===========================================================================*/
-void clear_endpoint(rc)
-register struct proc *rc; /* slot of process to clean up */
+void clear_endpoint(struct proc * rc)
{
+/* Clean up the slot of the process given as 'rc'. */
if(isemptyp(rc)) panic("clear_proc: empty process: %d", rc->p_endpoint);
/*===========================================================================*
* clear_ipc_refs *
*===========================================================================*/
-void clear_ipc_refs(rc, caller_ret)
-register struct proc *rc; /* slot of process to clean up */
-int caller_ret; /* code to return on callers */
+void clear_ipc_refs(
+ register struct proc *rc, /* slot of process to clean up */
+ int caller_ret /* code to return on callers */
+)
{
/* Clear IPC references for a given process slot. */
struct proc *rp; /* iterate over process table */
/*===========================================================================*
* generic_handler *
*===========================================================================*/
-static int generic_handler(hook)
-irq_hook_t *hook;
+static int generic_handler(irq_hook_t * hook)
{
/* This function handles hardware interrupt in a simple and generic way. All
* interrupts are transformed into messages to a driver. The IRQ line will be
/*===========================================================================*
* verify_grant *
*===========================================================================*/
-int verify_grant(granter, grantee, grant, bytes, access,
- offset_in, offset_result, e_granter, flags)
-endpoint_t granter, grantee; /* copyee, copyer */
-cp_grant_id_t grant; /* grant id */
-vir_bytes bytes; /* copy size */
-int access; /* direction (read/write) */
-vir_bytes offset_in; /* copy offset within grant */
-vir_bytes *offset_result; /* copy offset within virtual address space */
-endpoint_t *e_granter; /* new granter (magic grants) */
-u32_t *flags; /* CPF_* */
+int verify_grant(
+ endpoint_t granter, /* copyee */
+ endpoint_t grantee, /* copyer */
+ cp_grant_id_t grant, /* grant id */
+ vir_bytes bytes, /* copy size */
+ int access, /* direction (read/write) */
+ vir_bytes offset_in, /* copy offset within grant */
+ vir_bytes *offset_result, /* copy offset within virtual address space */
+ endpoint_t *e_granter, /* new granter (magic grants) */
+ u32_t *flags /* CPF_* */
+)
{
static cp_grant_t g;
static int proc_nr;
/*===========================================================================*
* safecopy *
*===========================================================================*/
-static int safecopy(caller, granter, grantee, grantid, bytes,
- g_offset, addr, access)
-struct proc * caller;
-endpoint_t granter, grantee;
-cp_grant_id_t grantid;
-size_t bytes;
-vir_bytes g_offset, addr;
-int access; /* CPF_READ for a copy from granter to grantee, CPF_WRITE
+static int safecopy(
+ struct proc * caller,
+ endpoint_t granter,
+ endpoint_t grantee,
+ cp_grant_id_t grantid,
+ size_t bytes,
+ vir_bytes g_offset,
+ vir_bytes addr,
+ int access /* CPF_READ for a copy from granter to grantee, CPF_WRITE
* for a copy from grantee to granter.
*/
+)
{
static struct vir_addr v_src, v_dst;
static vir_bytes v_offset;
/*===========================================================================*
* vtimer_check *
*===========================================================================*/
-void vtimer_check(rp)
-struct proc *rp; /* pointer to the process */
+void vtimer_check(struct proc * rp)
{
/* This is called from the clock task, so we can be interrupted by the clock
* interrupt, but not by the system task. Therefore we only have to protect
/*===========================================================================*
* kputc *
*===========================================================================*/
-void kputc(c)
-int c; /* character to append */
+void kputc(
+ int c /* character to append */
+)
{
/* Accumulate a single character for a kernel message. Send a notification
* to the output drivers if an END_OF_KMESS is encountered.
/*===========================================================================*
* _exit *
*===========================================================================*/
-void _exit(e)
-int e; /* error code */
+void _exit(
+ int e /* error code */
+)
{
panic("_exit called from within the kernel, should not happen. (err %i)", e);
}