Andy's formatting fixes.

This commit is contained in:
Ben Gras 2005-09-11 16:44:06 +00:00
parent f224cf091d
commit 5ae6f98dea
14 changed files with 210 additions and 210 deletions

View File

@ -23,15 +23,15 @@ void timer_start(int cat, char *name)
unsigned long h, l;
int i;
if(cat < 0 || cat >= TIMING_CATEGORIES) return;
if (cat < 0 || cat >= TIMING_CATEGORIES) return;
for(i = 0; i < sizeof(timingdata[0].names) && *name; i++)
timingdata[cat].names[i] = *name++;
timingdata[0].names[sizeof(timingdata[0].names)-1] = '\0';
if(starttimes[cat][HIGHCOUNT]) { return; }
if (starttimes[cat][HIGHCOUNT]) { return; }
if(!init) {
if (!init) {
int t, f;
init = 1;
for(t = 0; t < TIMING_CATEGORIES; t++) {
@ -50,14 +50,14 @@ void timer_end(int cat)
int bin;
read_tsc(&h, &l);
if(cat < 0 || cat >= TIMING_CATEGORIES) return;
if(!starttimes[cat][HIGHCOUNT]) {
if (cat < 0 || cat >= TIMING_CATEGORIES) return;
if (!starttimes[cat][HIGHCOUNT]) {
timingdata[cat].misses++;
return;
}
if(starttimes[cat][HIGHCOUNT] == h) {
if (starttimes[cat][HIGHCOUNT] == h) {
d = (l - starttimes[cat][1]);
} else if(starttimes[cat][HIGHCOUNT] == h-1 &&
} else if (starttimes[cat][HIGHCOUNT] == h-1 &&
starttimes[cat][LOWCOUNT] > l) {
d = ((ULONG_MAX - starttimes[cat][LOWCOUNT]) + l);
} else {
@ -65,14 +65,14 @@ void timer_end(int cat)
return;
}
starttimes[cat][HIGHCOUNT] = 0;
if(!timingdata[cat].lock_timings_range[0] ||
if (!timingdata[cat].lock_timings_range[0] ||
d < timingdata[cat].lock_timings_range[0] ||
d > timingdata[cat].lock_timings_range[1]) {
int t;
if(!timingdata[cat].lock_timings_range[0] ||
if (!timingdata[cat].lock_timings_range[0] ||
d < timingdata[cat].lock_timings_range[0])
timingdata[cat].lock_timings_range[0] = d;
if(!timingdata[cat].lock_timings_range[1] ||
if (!timingdata[cat].lock_timings_range[1] ||
d > timingdata[cat].lock_timings_range[1])
timingdata[cat].lock_timings_range[1] = d;
for(t = 0; t < TIMING_POINTS; t++)
@ -80,13 +80,13 @@ void timer_end(int cat)
timingdata[cat].binsize =
(timingdata[cat].lock_timings_range[1] -
timingdata[cat].lock_timings_range[0])/(TIMING_POINTS+1);
if(timingdata[cat].binsize < 1)
if (timingdata[cat].binsize < 1)
timingdata[cat].binsize = 1;
timingdata[cat].resets++;
}
bin = (d-timingdata[cat].lock_timings_range[0]) /
timingdata[cat].binsize;
if(bin < 0 || bin >= TIMING_POINTS) {
if (bin < 0 || bin >= TIMING_POINTS) {
int t;
/* this indicates a bug, but isn't really serious */
for(t = 0; t < TIMING_POINTS; t++)
@ -114,19 +114,19 @@ check_runqueues(char *when)
for (xp = BEG_PROC_ADDR; xp < END_PROC_ADDR; ++xp) {
xp->p_found = 0;
if(l++ > PROCLIMIT) { panic("check error", NO_NUM); }
if (l++ > PROCLIMIT) { panic("check error", NO_NUM); }
}
for (q=0; q < NR_SCHED_QUEUES; q++) {
if(rdy_head[q] && !rdy_tail[q]) {
if (rdy_head[q] && !rdy_tail[q]) {
kprintf("head but no tail: %s", when);
panic("scheduling error", NO_NUM);
}
if(!rdy_head[q] && rdy_tail[q]) {
if (!rdy_head[q] && rdy_tail[q]) {
kprintf("tail but no head: %s", when);
panic("scheduling error", NO_NUM);
}
if(rdy_tail[q] && rdy_tail[q]->p_nextready != NIL_PROC) {
if (rdy_tail[q] && rdy_tail[q]->p_nextready != NIL_PROC) {
kprintf("tail and tail->next not null; %s", when);
panic("scheduling error", NO_NUM);
}
@ -136,29 +136,29 @@ check_runqueues(char *when)
panic("found unready process on run queue", NO_NUM);
}
if(xp->p_priority != q) {
if (xp->p_priority != q) {
kprintf("scheduling error: wrong priority: %s\n", when);
panic("wrong priority", NO_NUM);
}
if(xp->p_found) {
if (xp->p_found) {
kprintf("scheduling error: double scheduling: %s\n", when);
panic("proc more than once on scheduling queue", NO_NUM);
}
xp->p_found = 1;
if(xp->p_nextready == NIL_PROC && rdy_tail[q] != xp) {
if (xp->p_nextready == NIL_PROC && rdy_tail[q] != xp) {
kprintf("scheduling error: last element not tail: %s\n", when);
panic("scheduling error", NO_NUM);
}
if(l++ > PROCLIMIT) panic("loop in schedule queue?", NO_NUM);
if (l++ > PROCLIMIT) panic("loop in schedule queue?", NO_NUM);
}
}
for (xp = BEG_PROC_ADDR; xp < END_PROC_ADDR; ++xp) {
if(! isemptyp(xp) && xp->p_ready && ! xp->p_found) {
if (! isemptyp(xp) && xp->p_ready && ! xp->p_found) {
kprintf("scheduling error: ready not on queue: %s\n", when);
panic("ready proc not on scheduling queue", NO_NUM);
if(l++ > PROCLIMIT) { panic("loop in proc.t?", NO_NUM); }
if (l++ > PROCLIMIT) { panic("loop in proc.t?", NO_NUM); }
}
}
}

View File

@ -7,9 +7,9 @@
#include <signal.h>
#include "proc.h"
/*==========================================================================*
/*===========================================================================*
* exception *
*==========================================================================*/
*===========================================================================*/
PUBLIC void exception(vec_nr)
unsigned vec_nr;
{

View File

@ -34,9 +34,9 @@ PRIVATE vecaddr_t irq_vec[] = {
#define set_vec(nr, addr) ((void)0)
#endif
/*==========================================================================*
/*===========================================================================*
* intr_init *
*==========================================================================*/
*===========================================================================*/
PUBLIC void intr_init(mine)
int mine;
{
@ -86,9 +86,9 @@ int mine;
}
}
/*=========================================================================*
/*===========================================================================*
* put_irq_handler *
*=========================================================================*/
*===========================================================================*/
PUBLIC void put_irq_handler(hook, irq, handler)
irq_hook_t *hook;
int irq;
@ -119,9 +119,9 @@ irq_handler_t handler;
irq_use |= 1 << irq;
}
/*=========================================================================*
/*===========================================================================*
* rm_irq_handler *
*=========================================================================*/
*===========================================================================*/
PUBLIC void rm_irq_handler(hook)
irq_hook_t *hook;
{
@ -135,9 +135,9 @@ irq_hook_t *hook;
line = &irq_handlers[irq];
while (*line != NULL) {
if((*line)->id == id) {
if ((*line)->id == id) {
(*line) = (*line)->next;
if(! irq_handlers[irq]) irq_use &= ~(1 << irq);
if (! irq_handlers[irq]) irq_use &= ~(1 << irq);
return;
}
line = &(*line)->next;
@ -145,9 +145,9 @@ irq_hook_t *hook;
/* When the handler is not found, normally return here. */
}
/*==========================================================================*
/*===========================================================================*
* intr_handle *
*==========================================================================*/
*===========================================================================*/
PUBLIC void intr_handle(hook)
irq_hook_t *hook;
{

View File

@ -166,9 +166,9 @@ PUBLIC void main()
restart();
}
/*==========================================================================*
/*===========================================================================*
* announce *
*==========================================================================*/
*===========================================================================*/
PRIVATE void announce(void)
{
/* Display the MINIX startup banner. */
@ -182,9 +182,9 @@ PRIVATE void announce(void)
#endif
}
/*==========================================================================*
/*===========================================================================*
* prepare_shutdown *
*==========================================================================*/
*===========================================================================*/
PUBLIC void prepare_shutdown(how)
int how;
{
@ -232,9 +232,9 @@ int how;
set_timer(&shutdown_timer, get_uptime() + HZ, shutdown);
}
/*==========================================================================*
/*===========================================================================*
* shutdown *
*==========================================================================*/
*===========================================================================*/
PRIVATE void shutdown(tp)
timer_t *tp;
{

View File

@ -361,9 +361,9 @@ int dst; /* which process to notify */
return(OK);
}
/*==========================================================================*
/*===========================================================================*
* lock_notify *
*==========================================================================*/
*===========================================================================*/
PUBLIC int lock_notify(src, dst)
int src; /* sender of the notification */
int dst; /* who is to be notified */
@ -406,7 +406,7 @@ register struct proc *rp; /* this process is now runnable */
#if DEBUG_SCHED_CHECK
check_runqueues("enqueue");
if(rp->p_ready) kprintf("enqueue() already ready process\n");
if (rp->p_ready) kprintf("enqueue() already ready process\n");
#endif
/* Determine where to insert to process. */
@ -559,9 +559,9 @@ PRIVATE void pick_proc()
}
}
/*==========================================================================*
/*===========================================================================*
* lock_send *
*==========================================================================*/
*===========================================================================*/
PUBLIC int lock_send(dst, m_ptr)
int dst; /* to whom is message being sent? */
message *m_ptr; /* pointer to message buffer */
@ -574,9 +574,9 @@ message *m_ptr; /* pointer to message buffer */
return(result);
}
/*==========================================================================*
/*===========================================================================*
* lock_enqueue *
*==========================================================================*/
*===========================================================================*/
PUBLIC void lock_enqueue(rp)
struct proc *rp; /* this process is now runnable */
{
@ -586,9 +586,9 @@ struct proc *rp; /* this process is now runnable */
unlock(3);
}
/*==========================================================================*
/*===========================================================================*
* lock_dequeue *
*==========================================================================*/
*===========================================================================*/
PUBLIC void lock_dequeue(rp)
struct proc *rp; /* this process is no longer runnable */
{

View File

@ -74,9 +74,9 @@ FORWARD _PROTOTYPE( void int_gate, (unsigned vec_nr, vir_bytes offset,
FORWARD _PROTOTYPE( void sdesc, (struct segdesc_s *segdp, phys_bytes base,
vir_bytes size) );
/*=========================================================================*
/*===========================================================================*
* prot_init *
*=========================================================================*/
*===========================================================================*/
PUBLIC void prot_init()
{
/* Set up tables for protected mode.
@ -191,9 +191,9 @@ PUBLIC void prot_init()
#endif
}
/*=========================================================================*
/*===========================================================================*
* init_codeseg *
*=========================================================================*/
*===========================================================================*/
PUBLIC void init_codeseg(segdp, base, size, privilege)
register struct segdesc_s *segdp;
phys_bytes base;
@ -207,9 +207,9 @@ int privilege;
/* CONFORMING = 0, ACCESSED = 0 */
}
/*=========================================================================*
/*===========================================================================*
* init_dataseg *
*=========================================================================*/
*===========================================================================*/
PUBLIC void init_dataseg(segdp, base, size, privilege)
register struct segdesc_s *segdp;
phys_bytes base;
@ -222,9 +222,9 @@ int privilege;
/* EXECUTABLE = 0, EXPAND_DOWN = 0, ACCESSED = 0 */
}
/*=========================================================================*
/*===========================================================================*
* sdesc *
*=========================================================================*/
*===========================================================================*/
PRIVATE void sdesc(segdp, base, size)
register struct segdesc_s *segdp;
phys_bytes base;
@ -251,9 +251,9 @@ vir_bytes size;
#endif
}
/*=========================================================================*
/*===========================================================================*
* seg2phys *
*=========================================================================*/
*===========================================================================*/
PUBLIC phys_bytes seg2phys(seg)
U16_t seg;
{
@ -274,9 +274,9 @@ U16_t seg;
return base;
}
/*=========================================================================*
/*===========================================================================*
* phys2seg *
*=========================================================================*/
*===========================================================================*/
PUBLIC void phys2seg(seg, off, phys)
u16_t *seg;
vir_bytes *off;
@ -302,9 +302,9 @@ phys_bytes phys;
#endif
}
/*=========================================================================*
/*===========================================================================*
* int_gate *
*=========================================================================*/
*===========================================================================*/
PRIVATE void int_gate(vec_nr, offset, dpl_type)
unsigned vec_nr;
vir_bytes offset;
@ -322,9 +322,9 @@ unsigned dpl_type;
#endif
}
/*=========================================================================*
/*===========================================================================*
* enable_iop *
*=========================================================================*/
*===========================================================================*/
PUBLIC void enable_iop(pp)
struct proc *pp;
{
@ -336,9 +336,9 @@ struct proc *pp;
pp->p_reg.psw |= 0x3000;
}
/*==========================================================================*
/*===========================================================================*
* alloc_segments *
*==========================================================================*/
*===========================================================================*/
PUBLIC void alloc_segments(rp)
register struct proc *rp;
{

View File

@ -15,10 +15,9 @@
#include <string.h>
FORWARD _PROTOTYPE( char *get_value, (_CONST char *params, _CONST char *key));
/*==========================================================================*
/*===========================================================================*
* cstart *
*==========================================================================*/
*===========================================================================*/
PUBLIC void cstart(cs, ds, mds, parmoff, parmsize)
U16_t cs, ds; /* kernel code and data segment */
U16_t mds; /* monitor data segment */
@ -92,9 +91,10 @@ U16_t parmoff, parmsize; /* boot parameters offset and length */
*/
}
/*==========================================================================*
/*===========================================================================*
* get_value *
*==========================================================================*/
*===========================================================================*/
PRIVATE char *get_value(params, name)
_CONST char *params; /* boot monitor parameters */
_CONST char *name; /* key to look up */

View File

@ -217,7 +217,7 @@ int source;
source %= RANDOM_SOURCES;
r_next= krandom.bin[source].r_next;
if(machine.processor > 486) {
if (machine.processor > 486) {
read_tsc(&tsc_high, &tsc_low);
krandom.bin[source].r_buf[r_next] = tsc_low;
} else {
@ -347,10 +347,10 @@ vir_bytes bytes; /* # of bytes to be copied */
seg = (vc < rp->p_memmap[S].mem_vir ? D : S);
#endif
if((vir_addr>>CLICK_SHIFT) >= rp->p_memmap[seg].mem_vir +
if ((vir_addr>>CLICK_SHIFT) >= rp->p_memmap[seg].mem_vir +
rp->p_memmap[seg].mem_len) return( (phys_bytes) 0 );
if(vc >= rp->p_memmap[seg].mem_vir +
if (vc >= rp->p_memmap[seg].mem_vir +
rp->p_memmap[seg].mem_len) return( (phys_bytes) 0 );
#if (CHIP == INTEL)
@ -391,9 +391,9 @@ vir_bytes bytes; /* # of bytes to be copied */
return(fm->mem_phys + (phys_bytes) vir_addr);
}
/*==========================================================================*
/*===========================================================================*
* virtual_copy *
*==========================================================================*/
*===========================================================================*/
PUBLIC int virtual_copy(src_addr, dst_addr, bytes)
struct vir_addr *src_addr; /* source virtual address */
struct vir_addr *dst_addr; /* destination virtual address */