#include <errno.h>
#define STARTDAY 0 /* see ctime(3) */
-#define LEAPDAY STARTDAY+59
-#define MAXDAYNR STARTDAY+365
-#define NODAY -2
+#define LEAPDAY (STARTDAY+59)
+#define MAXDAYNR (STARTDAY+365)
+#define NODAY (-2)
char CRONPID[] = "/usr/run/cron.pid";
_PROTOTYPE(int main, (int argc, char **argv, char **envp));
static char obuf[CHUNK_SIZE];
static char *op = obuf;
-int main(int argc, char **argv);
static void copyout(char *file, int fd);
static void output(char *buf, size_t count);
-static void report(char *label);
-static void fatal(char *label);
+static void report(const char *label);
+static void fatal(const char *label);
static char STDIN[] = "standard input";
static char STDOUT[] = "standard output";
return(excode);
}
-static void copyout(char *file, int fd)
+static void copyout(const char *file, int fd)
{
int n;
}
}
-static void report(char *label)
+static void report(const char *label)
{
int e = errno;
std_err("cat: ");
excode = 1;
}
-static void fatal(char *label)
+static void fatal(const char *label)
{
report(label);
exit(1);
_PROTOTYPE (static void or_watchdog_f, (timer_t *tp) );
_PROTOTYPE (static void setup_wepkey, (t_or *orp, char *wepkey0) );
_PROTOTYPE (static void or_getstat, (message *m));
-_PROTOTYPE (static int do_hard_int, (void));
+_PROTOTYPE (static void do_hard_int, (void));
_PROTOTYPE (static void check_int_events, (void));
_PROTOTYPE (static void or_getname, (message *m));
-_PROTOTYPE (static int or_handler, (t_or *orp));
+_PROTOTYPE (static void or_handler, (t_or *orp));
_PROTOTYPE (static void or_dump, (message *m));
/* The message used in the main loop is made global, so that rl_watchdog_f()
* *
* Process the interrupts which the card generated *
*****************************************************************************/
-static int do_hard_int(void) {
+static void do_hard_int(void)
+{
u16_t evstat;
hermes_t *hw;
int i,s;
* like EV_INFO and EV_RX have to be handled before an acknowledgement for *
* the event is returned to the card. See also the documentation *
*****************************************************************************/
-static int or_handler (t_or *orp) {
+static void or_handler (t_or *orp)
+{
int i, err, length, nr = 0;
u16_t evstat, events, fid;
hermes_t *hw;
_PROTOTYPE( static void reply, (re_t *rep, int err, int may_block) );
_PROTOTYPE( static void mess_reply, (message *req, message *reply) );
_PROTOTYPE( static void check_int_events, (void) );
-_PROTOTYPE( static int do_hard_int, (void) );
+_PROTOTYPE( static void do_hard_int, (void) );
_PROTOTYPE( static void rtl8139_dump, (message *m) );
#if 0
_PROTOTYPE( static void dump_phy, (re_t *rep) );
}
#endif
-static int do_hard_int(void)
+static void do_hard_int(void)
{
int i,s;
mixer_set(input_cmd, mask);
} else { /* Get input */
if (shift > 0) {
- input.left = ((mask >> (shift+1)) & 1 == 1 ? ON : OFF);
- input.right = ((mask >> shift) & 1 == 1 ? ON : OFF);
+ input.left = (((mask >> (shift+1)) & 1) == 1 ? ON : OFF);
+ input.right = (((mask >> shift) & 1) == 1 ? ON : OFF);
} else {
input.left = ((mask & 1) == 1 ? ON : OFF);
}
mixer_set(MIXER_OUTPUT_CTRL, mask);
} else { /* Get input */
if (shift > 0) {
- output.left = ((mask >> (shift+1)) & 1 == 1 ? ON : OFF);
- output.right = ((mask >> shift) & 1 == 1 ? ON : OFF);
+ output.left = (((mask >> (shift+1)) & 1) == 1 ? ON : OFF);
+ output.right = (((mask >> shift) & 1) == 1 ? ON : OFF);
} else {
output.left = ((mask & 1) == 1 ? ON : OFF);
}
PUBLIC int ioapic_enabled;
PUBLIC u32_t ioapic_id_mask[8], lapic_id_mask[8];
PUBLIC u32_t lapic_addr_vaddr;
-PUBLIC u32_t lapic_addr;
+PUBLIC vir_bytes lapic_addr;
PUBLIC u32_t lapic_eoi_addr;
PUBLIC u32_t lapic_taskpri_addr;
PUBLIC int bsp_lapic_id;
#include "../../kernel.h"
EXTERN int ioapic_enabled;
-EXTERN u32_t lapic_addr;
+EXTERN vir_bytes lapic_addr;
EXTERN u32_t lapic_eoi_addr;
EXTERN u32_t lapic_taskpri_addr;
EXTERN int bsp_lapic_id;
{
vir_bytes newoffset;
endpoint_t newep;
- int proc_nr, proc_nr_e = m_ptr->DIO_VEC_ENDPT;
- int count = m_ptr->DIO_VEC_SIZE;
+ int proc_nr;
+ endpoint_t proc_nr_e = m_ptr->DIO_VEC_ENDPT;
+ vir_bytes count = m_ptr->DIO_VEC_SIZE;
long port = m_ptr->DIO_PORT;
phys_bytes phys_buf;
int i, req_type, req_dir, size, nr_io_range;
#include "../../proc.h"
#include "../../proto.h"
-extern int vm_copy_in_progress, catch_pagefaults;
-extern struct proc *vm_copy_from, *vm_copy_to;
+extern int catch_pagefaults;
void pagefault( struct proc *pr,
struct exception_frame * frame,
struct proc *dstproc, vir_bytes dstlinaddr, vir_bytes bytes)
{
u32_t addr;
- int procslot;
+ proc_nr_t procslot;
NOREC_ENTER(linlincopy);
caller->p_delivermsg_vir,
caller->p_name,
caller->p_endpoint);
- result = EBADREQUEST;
}
}
}
int (*handler)(struct irq_hook *); /* interrupt handler */
int irq; /* IRQ vector number */
int id; /* id of this hook */
- int proc_nr_e; /* (endpoint) NONE if not in use */
+ endpoint_t proc_nr_e; /* (endpoint) NONE if not in use */
irq_id_t notify_id; /* id to return on interrupt */
irq_policy_t policy; /* bit mask for policy */
} irq_hook_t;
return NW_SUSPEND;
}
-PRIVATE int udp_sel_read (udp_fd)
-udp_fd_t *udp_fd;
+PRIVATE int udp_sel_read (udp_fd_t *udp_fd)
{
- acc_t *pack, *tmp_acc, *next_acc;
- int result;
+ acc_t *tmp_acc, *next_acc;
if (!(udp_fd->uf_flags & UFF_OPTSET))
return 1; /* Read will not block */
unsigned short *buf;
struct semid_ds *ds, tmp_ds;
struct sem_struct *sem;
- struct semaphore *semaphore;
id = m->SEMCTL_ID;
num = m->SEMCTL_NUM;
*===========================================================================*/
PUBLIC int do_shmdt(message *m)
{
- struct shm_struct *shm;
vir_bytes addr;
phys_bytes paddr;
- int n, i;
+ int i;
addr = m->SHMDT_ADDR;
{
struct rproc *rp;
struct rprocpub *rpub;
- int i,j, n=0;
+ int i, n=0;
static int prev_i=0;
getsysinfo(RS_PROC_NR, SI_PROCPUB_TAB, rprocpub);
* maximum number of ids the filesystem can
* handle */
-#define NO_ADDRESS -1 /* Error constants */
-#define NO_FREE_INODES -1
+#define NO_ADDRESS (-1) /* Error constants */
+#define NO_FREE_INODES (-1)
#define PATH_PENULTIMATE 001 /* parse_path stops at last but one name */
#define PATH_NONSYMBOLIC 004 /* parse_path scans final name if symbolic */
int *vec_grants;
vir_bytes bytes;
{
- int access = 0, size;
+ int size;
int j;
iovec_t *v;
static iovec_t new_iovec[NR_IOREQS];
#include "inc.h"
-#include <string.h>
-#include <minix/com.h>
#include <minix/vfsif.h>
#include <minix/ds.h>
#include "const.h"
/*===========================================================================*
* fs_mountpoint *
*===========================================================================*/
-PUBLIC int fs_mountpoint() {
+PUBLIC int fs_mountpoint()
+{
/* This function looks up the mount point, it checks the condition whether
* the partition can be mounted on the inode or not.
*/
register struct dir_record *rip;
int r = OK;
- mode_t bits;
/* Temporarily open the file. */
if ((rip = get_dir_record(fs_m_in.REQ_INODE_NR)) == NULL)
* timeout and wait for either the file descriptors to become ready or the
* timer to go off. If no timeout value was provided, we wait indefinitely. */
- int r, nfds, do_timeout = 0, nonzero_timeout = 0, fd, s;
+ int r, nfds, do_timeout = 0, fd, s;
struct timeval timeout;
struct selectentry *se;