Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
rsc committed Aug 28, 2007
1 parent a759b8a commit 3341e30
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
6 changes: 3 additions & 3 deletions cat.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
char buf[512];

void
rfile(int fd)
cat(int fd)
{
int n;

Expand All @@ -23,7 +23,7 @@ main(int argc, char *argv[])
int fd, i;

if(argc <= 1) {
rfile(0);
cat(0);
exit();
}

Expand All @@ -32,7 +32,7 @@ main(int argc, char *argv[])
printf(1, "cat: cannot open %s\n", argv[i]);
exit();
}
rfile(fd);
cat(fd);
close(fd);
}
exit();
Expand Down
2 changes: 1 addition & 1 deletion fcntl.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define O_CREATE 0x200
#define O_RDONLY 0x000
#define O_WRONLY 0x001
#define O_RDWR 0x002
#define O_CREATE 0x200
6 changes: 3 additions & 3 deletions fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ ilock(struct inode *ip)

if(!(ip->flags & I_VALID)){
bp = bread(ip->dev, IBLOCK(ip->inum));
dip = &((struct dinode*)(bp->data))[ip->inum % IPB];
dip = (struct dinode*)bp->data + ip->inum%IPB;
ip->type = dip->type;
ip->major = dip->major;
ip->minor = dip->minor;
Expand Down Expand Up @@ -275,7 +275,7 @@ ialloc(uint dev, short type)
readsb(dev, &sb);
for(inum = 1; inum < sb.ninodes; inum++) { // loop over inode blocks
bp = bread(dev, IBLOCK(inum));
dip = (struct dinode*)(bp->data) + inum%IPB;
dip = (struct dinode*)bp->data + inum%IPB;
if(dip->type == 0) { // a free inode
memset(dip, 0, sizeof(*dip));
dip->type = type;
Expand All @@ -296,7 +296,7 @@ iupdate(struct inode *ip)
struct dinode *dip;

bp = bread(ip->dev, IBLOCK(ip->inum));
dip = (struct dinode*)(bp->data) + ip->inum%IPB;
dip = (struct dinode*)bp->data + ip->inum%IPB;
dip->type = ip->type;
dip->major = ip->major;
dip->minor = ip->minor;
Expand Down
10 changes: 4 additions & 6 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
#include "proc.h"
#include "x86.h"

extern char edata[], end[];

void bootothers(void);
static void bootothers(void);

// Bootstrap processor starts running C code here.
int
main(void)
{
int i;
static volatile int bcpu; // cannot be on stack
extern char edata[], end[];

// clear BSS
memset(edata, 0, end - edata);
Expand Down Expand Up @@ -65,7 +64,6 @@ mpmain(void)
idtinit();
lapic_init(cpu());
setupsegs(0);

cpuid(0, 0, 0, 0, 0); // memory barrier
cpus[cpu()].booted = 1;

Expand All @@ -76,7 +74,7 @@ mpmain(void)
scheduler();
}

void
static void
bootothers(void)
{
extern uchar _binary_bootother_start[], _binary_bootother_size[];
Expand All @@ -91,7 +89,7 @@ bootothers(void)
if(c == cpus+cpu()) // We've started already.
continue;

// Set target %esp, %eip
// Fill in %esp, %eip and start code on cpu.
*(void**)(code-4) = c->mpstack + MPSTACK;
*(void**)(code-8) = mpmain;
lapic_startap(c->apicid, (uint)code);
Expand Down

0 comments on commit 3341e30

Please sign in to comment.