summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrans Kaashoek <[email protected]>2016-08-25 09:13:00 -0400
committerFrans Kaashoek <[email protected]>2016-08-25 09:13:00 -0400
commit7894fcd21732dd2ddfbb9beca52d037a62ed11f4 (patch)
treeeabcfc4f08613dcf7c35e58d9425f02c4c65224f
parent6de6a3c952dc8786619bd052e26e6bc1c97be2e6 (diff)
downloadxv6-labs-7894fcd21732dd2ddfbb9beca52d037a62ed11f4.tar.gz
xv6-labs-7894fcd21732dd2ddfbb9beca52d037a62ed11f4.tar.bz2
xv6-labs-7894fcd21732dd2ddfbb9beca52d037a62ed11f4.zip
Remove trailing white space with:
for f in *.{h,c}; do sed -i .sed 's/[[:blank:]]*$//' $f; done (Thanks to Nicolás Wolovick)
-rw-r--r--bio.c6
-rw-r--r--bootmain.c2
-rw-r--r--console.c8
-rw-r--r--file.c2
-rw-r--r--forktest.c8
-rw-r--r--fs.c14
-rw-r--r--fs.h2
-rw-r--r--grep.c6
-rw-r--r--ide.c22
-rw-r--r--ioapic.c2
-rw-r--r--log.c14
-rw-r--r--ls.c12
-rw-r--r--main.c6
-rw-r--r--memide.c4
-rw-r--r--mkfs.c4
-rw-r--r--mmu.h4
-rw-r--r--proc.c18
-rw-r--r--proc.h2
-rw-r--r--sh.c22
-rw-r--r--spinlock.c4
-rw-r--r--spinlock.h2
-rw-r--r--stressfs.c2
-rw-r--r--string.c6
-rw-r--r--syscall.c2
-rw-r--r--sysproc.c4
-rw-r--r--trap.c8
-rw-r--r--uart.c4
-rw-r--r--ulib.c2
-rw-r--r--usertests.c20
-rw-r--r--vm.c14
-rw-r--r--x86.h4
-rw-r--r--zombie.c2
32 files changed, 116 insertions, 116 deletions
diff --git a/bio.c b/bio.c
index 629bb2c..6c19a64 100644
--- a/bio.c
+++ b/bio.c
@@ -4,7 +4,7 @@
// cached copies of disk block contents. Caching disk blocks
// in memory reduces the number of disk reads and also provides
// a synchronization point for disk blocks used by multiple processes.
-//
+//
// Interface:
// * To get a buffer for a particular disk block, call bread.
// * After changing buffer data, call bwrite to write it to disk.
@@ -12,10 +12,10 @@
// * Do not use the buffer after calling brelse.
// * Only one process at a time can use a buffer,
// so do not keep them longer than necessary.
-//
+//
// The implementation uses three state flags internally:
// * B_BUSY: the block has been returned from bread
-// and has not been passed back to brelse.
+// and has not been passed back to brelse.
// * B_VALID: the buffer data has been read from the disk.
// * B_DIRTY: the buffer data has been modified
// and needs to be written to disk.
diff --git a/bootmain.c b/bootmain.c
index 97d5258..1f20e5b 100644
--- a/bootmain.c
+++ b/bootmain.c
@@ -1,5 +1,5 @@
// Boot loader.
-//
+//
// Part of the boot block, along with bootasm.S, which calls bootmain().
// bootasm.S has put the processor into protected 32-bit mode.
// bootmain() loads an ELF kernel image from the disk starting at
diff --git a/console.c b/console.c
index 35f221d..298a6e7 100644
--- a/console.c
+++ b/console.c
@@ -107,7 +107,7 @@ panic(char *s)
{
int i;
uint pcs[10];
-
+
cli();
cons.locking = 0;
cprintf("cpu%d: panic: ", cpu->id);
@@ -130,7 +130,7 @@ static void
cgaputc(int c)
{
int pos;
-
+
// Cursor position: col + 80*row.
outb(CRTPORT, 14);
pos = inb(CRTPORT+1) << 8;
@@ -146,13 +146,13 @@ cgaputc(int c)
if(pos < 0 || pos > 25*80)
panic("pos under/overflow");
-
+
if((pos/80) >= 24){ // Scroll up.
memmove(crt, crt+80, sizeof(crt[0])*23*80);
pos -= 80;
memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos));
}
-
+
outb(CRTPORT, 14);
outb(CRTPORT+1, pos>>8);
outb(CRTPORT, 15);
diff --git a/file.c b/file.c
index 98cad1e..85bb403 100644
--- a/file.c
+++ b/file.c
@@ -68,7 +68,7 @@ fileclose(struct file *f)
f->ref = 0;
f->type = FD_NONE;
release(&ftable.lock);
-
+
if(ff.type == FD_PIPE)
pipeclose(ff.pipe, ff.writable);
else if(ff.type == FD_INODE){
diff --git a/forktest.c b/forktest.c
index bb286e6..73f2fe8 100644
--- a/forktest.c
+++ b/forktest.c
@@ -27,24 +27,24 @@ forktest(void)
if(pid == 0)
exit();
}
-
+
if(n == N){
printf(1, "fork claimed to work N times!\n", N);
exit();
}
-
+
for(; n > 0; n--){
if(wait() < 0){
printf(1, "wait stopped early\n");
exit();
}
}
-
+
if(wait() != -1){
printf(1, "wait got too many\n");
exit();
}
-
+
printf(1, "fork test OK\n");
}
diff --git a/fs.c b/fs.c
index 025b326..f800b77 100644
--- a/fs.c
+++ b/fs.c
@@ -5,7 +5,7 @@
// + Directories: inode with special contents (list of other inodes!)
// + Names: paths like /usr/rtm/xv6/fs.c for convenient naming.
//
-// This file contains the low-level file system manipulation
+// This file contains the low-level file system manipulation
// routines. The (higher-level) system call implementations
// are in sysfile.c.
@@ -29,7 +29,7 @@ void
readsb(int dev, struct superblock *sb)
{
struct buf *bp;
-
+
bp = bread(dev, 1);
memmove(sb, bp->data, sizeof(*sb));
brelse(bp);
@@ -40,14 +40,14 @@ static void
bzero(int dev, int bno)
{
struct buf *bp;
-
+
bp = bread(dev, bno);
memset(bp->data, 0, BSIZE);
log_write(bp);
brelse(bp);
}
-// Blocks.
+// Blocks.
// Allocate a zeroed disk block.
static uint
@@ -348,7 +348,7 @@ iunlockput(struct inode *ip)
//
// The content (data) associated with each inode is stored
// in blocks on the disk. The first NDIRECT block numbers
-// are listed in ip->addrs[]. The next NINDIRECT blocks are
+// are listed in ip->addrs[]. The next NINDIRECT blocks are
// listed in block ip->addrs[NDIRECT].
// Return the disk block address of the nth block in inode ip.
@@ -401,7 +401,7 @@ itrunc(struct inode *ip)
ip->addrs[i] = 0;
}
}
-
+
if(ip->addrs[NDIRECT]){
bp = bread(ip->dev, ip->addrs[NDIRECT]);
a = (uint*)bp->data;
@@ -554,7 +554,7 @@ dirlink(struct inode *dp, char *name, uint inum)
de.inum = inum;
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("dirlink");
-
+
return 0;
}
diff --git a/fs.h b/fs.h
index e1d7d09..e64ecc0 100644
--- a/fs.h
+++ b/fs.h
@@ -1,4 +1,4 @@
-// On-disk file system format.
+// On-disk file system format.
// Both the kernel and user programs use this header file.
diff --git a/grep.c b/grep.c
index 28ff11a..adc4835 100644
--- a/grep.c
+++ b/grep.c
@@ -12,7 +12,7 @@ grep(char *pattern, int fd)
{
int n, m;
char *p, *q;
-
+
m = 0;
while((n = read(fd, buf+m, sizeof(buf)-m-1)) > 0){
m += n;
@@ -40,13 +40,13 @@ main(int argc, char *argv[])
{
int fd, i;
char *pattern;
-
+
if(argc <= 1){
printf(2, "usage: grep pattern [file ...]\n");
exit();
}
pattern = argv[1];
-
+
if(argc <= 2){
grep(pattern, 0);
exit();
diff --git a/ide.c b/ide.c
index 2606b9e..7fad55d 100644
--- a/ide.c
+++ b/ide.c
@@ -39,7 +39,7 @@ idewait(int checkerr)
{
int r;
- while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
+ while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
;
if(checkerr && (r & (IDE_DF|IDE_ERR)) != 0)
return -1;
@@ -50,12 +50,12 @@ void
ideinit(void)
{
int i;
-
+
initlock(&idelock, "ide");
picenable(IRQ_IDE);
ioapicenable(IRQ_IDE, ncpu - 1);
idewait(0);
-
+
// Check if disk 1 is present
outb(0x1f6, 0xe0 | (1<<4));
for(i=0; i<1000; i++){
@@ -64,7 +64,7 @@ ideinit(void)
break;
}
}
-
+
// Switch back to disk 0.
outb(0x1f6, 0xe0 | (0<<4));
}
@@ -81,9 +81,9 @@ idestart(struct buf *b)
int sector = b->blockno * sector_per_block;
int read_cmd = (sector_per_block == 1) ? IDE_CMD_READ : IDE_CMD_RDMUL;
int write_cmd = (sector_per_block == 1) ? IDE_CMD_WRITE : IDE_CMD_WRMUL;
-
+
if (sector_per_block > 7) panic("idestart");
-
+
idewait(0);
outb(0x3f6, 0); // generate interrupt
outb(0x1f2, sector_per_block); // number of sectors
@@ -117,12 +117,12 @@ ideintr(void)
// Read data if needed.
if(!(b->flags & B_DIRTY) && idewait(1) >= 0)
insl(0x1f0, b->data, BSIZE/4);
-
+
// Wake process waiting for this buf.
b->flags |= B_VALID;
b->flags &= ~B_DIRTY;
wakeup(b);
-
+
// Start disk on next buf in queue.
if(idequeue != 0)
idestart(idequeue);
@@ -131,7 +131,7 @@ ideintr(void)
}
//PAGEBREAK!
-// Sync buf with disk.
+// Sync buf with disk.
// If B_DIRTY is set, write buf to disk, clear B_DIRTY, set B_VALID.
// Else if B_VALID is not set, read buf from disk, set B_VALID.
void
@@ -153,11 +153,11 @@ iderw(struct buf *b)
for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue
;
*pp = b;
-
+
// Start disk if necessary.
if(idequeue == b)
idestart(b);
-
+
// Wait for request to finish.
while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
sleep(b, &idelock);
diff --git a/ioapic.c b/ioapic.c
index d343611..0e9116f 100644
--- a/ioapic.c
+++ b/ioapic.c
@@ -13,7 +13,7 @@
#define REG_TABLE 0x10 // Redirection table base
// The redirection table starts at REG_TABLE and uses
-// two registers to configure each interrupt.
+// two registers to configure each interrupt.
// The first (low) register in a pair contains configuration bits.
// The second (high) register contains a bitmask telling which
// CPUs can serve that interrupt.
diff --git a/log.c b/log.c
index 12db8ca..a2f1b57 100644
--- a/log.c
+++ b/log.c
@@ -31,7 +31,7 @@
// Contents of the header block, used for both the on-disk header block
// and to keep track in memory of logged block# before commit.
struct logheader {
- int n;
+ int n;
int block[LOGSIZE];
};
@@ -65,7 +65,7 @@ initlog(int dev)
}
// Copy committed blocks from log to their home location
-static void
+static void
install_trans(void)
{
int tail;
@@ -75,7 +75,7 @@ install_trans(void)
struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst
bwrite(dbuf); // write dst to disk
- brelse(lbuf);
+ brelse(lbuf);
brelse(dbuf);
}
}
@@ -114,7 +114,7 @@ write_head(void)
static void
recover_from_log(void)
{
- read_head();
+ read_head();
install_trans(); // if committed, copy from log to disk
log.lh.n = 0;
write_head(); // clear the log
@@ -171,7 +171,7 @@ end_op(void)
}
// Copy modified blocks from cache to log.
-static void
+static void
write_log(void)
{
int tail;
@@ -181,7 +181,7 @@ write_log(void)
struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
memmove(to->data, from->data, BSIZE);
bwrite(to); // write the log
- brelse(from);
+ brelse(from);
brelse(to);
}
}
@@ -193,7 +193,7 @@ commit()
write_log(); // Write modified blocks from cache to log
write_head(); // Write header to disk -- the real commit
install_trans(); // Now install writes to home locations
- log.lh.n = 0;
+ log.lh.n = 0;
write_head(); // Erase the transaction from the log
}
}
diff --git a/ls.c b/ls.c
index b6ddd7f..2862913 100644
--- a/ls.c
+++ b/ls.c
@@ -8,12 +8,12 @@ fmtname(char *path)
{
static char buf[DIRSIZ+1];
char *p;
-
+
// Find first character after last slash.
for(p=path+strlen(path); p >= path && *p != '/'; p--)
;
p++;
-
+
// Return blank-padded name.
if(strlen(p) >= DIRSIZ)
return p;
@@ -29,23 +29,23 @@ ls(char *path)
int fd;
struct dirent de;
struct stat st;
-
+
if((fd = open(path, 0)) < 0){
printf(2, "ls: cannot open %s\n", path);
return;
}
-
+
if(fstat(fd, &st) < 0){
printf(2, "ls: cannot stat %s\n", path);
close(fd);
return;
}
-
+
switch(st.type){
case T_FILE:
printf(1, "%s %d %d %d\n", fmtname(path), st.type, st.ino, st.size);
break;
-
+
case T_DIR:
if(strlen(path) + 1 + DIRSIZ + 1 > sizeof buf){
printf(1, "ls: path too long\n");
diff --git a/main.c b/main.c
index 74e61fb..2972b21 100644
--- a/main.c
+++ b/main.c
@@ -44,7 +44,7 @@ main(void)
static void
mpenter(void)
{
- switchkvm();
+ switchkvm();
seginit();
lapicinit();
mpmain();
@@ -81,7 +81,7 @@ startothers(void)
if(c == cpus+cpunum()) // We've started already.
continue;
- // Tell entryother.S what stack to use, where to enter, and what
+ // Tell entryother.S what stack to use, where to enter, and what
// pgdir to use. We cannot use kpgdir yet, because the AP processor
// is running in low memory, so we use entrypgdir for the APs too.
stack = kalloc();
@@ -99,7 +99,7 @@ startothers(void)
// The boot page table used in entry.S and entryother.S.
// Page directories (and page tables) must start on page boundaries,
-// hence the __aligned__ attribute.
+// hence the __aligned__ attribute.
// PTE_PS in a page directory entry enables 4Mbyte pages.
__attribute__((__aligned__(PGSIZE)))
diff --git a/memide.c b/memide.c
index 91b7f92..38be9a4 100644
--- a/memide.c
+++ b/memide.c
@@ -31,7 +31,7 @@ ideintr(void)
// no-op
}
-// Sync buf with disk.
+// Sync buf with disk.
// If B_DIRTY is set, write buf to disk, clear B_DIRTY, set B_VALID.
// Else if B_VALID is not set, read buf from disk, set B_VALID.
void
@@ -49,7 +49,7 @@ iderw(struct buf *b)
panic("iderw: block out of range");
p = memdisk + b->blockno*BSIZE;
-
+
if(b->flags & B_DIRTY){
b->flags &= ~B_DIRTY;
memmove(p, b->data, BSIZE);
diff --git a/mkfs.c b/mkfs.c
index 0a10754..8e011a7 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -22,7 +22,7 @@
int nbitmap = FSSIZE/(BSIZE*8) + 1;
int ninodeblocks = NINODES / IPB + 1;
-int nlog = LOGSIZE;
+int nlog = LOGSIZE;
int nmeta; // Number of meta blocks (boot, sb, nlog, inode, bitmap)
int nblocks; // Number of data blocks
@@ -134,7 +134,7 @@ main(int argc, char *argv[])
perror(argv[i]);
exit(1);
}
-
+
// Skip leading _ in name when writing to file system.
// The binaries are named _rm, _cat, etc. to keep the
// build operating system from trying to execute them
diff --git a/mmu.h b/mmu.h
index 310d5de..e732ccd 100644
--- a/mmu.h
+++ b/mmu.h
@@ -1,4 +1,4 @@
-// This file contains definitions for the
+// This file contains definitions for the
// x86 memory management unit (MMU).
// Eflags register
@@ -110,7 +110,7 @@ struct segdesc {
// | Page Directory | Page Table | Offset within Page |
// | Index | Index | |
// +----------------+----------------+---------------------+
-// \--- PDX(va) --/ \--- PTX(va) --/
+// \--- PDX(va) --/ \--- PTX(va) --/
// page directory index
#define PDX(va) (((uint)(va) >> PDXSHIFT) & 0x3FF)
diff --git a/proc.c b/proc.c
index 85f3f17..751d886 100644
--- a/proc.c
+++ b/proc.c
@@ -53,11 +53,11 @@ found:
return 0;
}
sp = p->kstack + KSTACKSIZE;
-
+
// Leave room for trap frame.
sp -= sizeof *p->tf;
p->tf = (struct trapframe*)sp;
-
+
// Set up new context to start executing at forkret,
// which returns to trapret.
sp -= 4;
@@ -78,7 +78,7 @@ userinit(void)
{
struct proc *p;
extern char _binary_initcode_start[], _binary_initcode_size[];
-
+
acquire(&ptable.lock);
p = allocproc();
@@ -110,7 +110,7 @@ int
growproc(int n)
{
uint sz;
-
+
sz = proc->sz;
if(n > 0){
if((sz = allocuvm(proc->pgdir, sz, sz + n)) == 0)
@@ -162,13 +162,13 @@ fork(void)
np->cwd = idup(proc->cwd);
safestrcpy(np->name, proc->name, sizeof(proc->name));
-
+
pid = np->pid;
np->state = RUNNABLE;
release(&ptable.lock);
-
+
return pid;
}
@@ -342,13 +342,13 @@ forkret(void)
if (first) {
// Some initialization functions must be run in the context
- // of a regular process (e.g., they call sleep), and thus cannot
+ // of a regular process (e.g., they call sleep), and thus cannot
// be run from main().
first = 0;
iinit(ROOTDEV);
initlog(ROOTDEV);
}
-
+
// Return to "caller", actually trapret (see allocproc).
}
@@ -453,7 +453,7 @@ procdump(void)
struct proc *p;
char *state;
uint pc[10];
-
+
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
if(p->state == UNUSED)
continue;
diff --git a/proc.h b/proc.h
index 33a9558..d1597cf 100644
--- a/proc.h
+++ b/proc.h
@@ -7,7 +7,7 @@ struct cpu {
volatile uint started; // Has the CPU started?
int ncli; // Depth of pushcli nesting.
int intena; // Were interrupts enabled before pushcli?
-
+
// Cpu-local storage variables; see below
struct cpu *cpu;
struct proc *proc; // The currently-running process.
diff --git a/sh.c b/sh.c
index 3ac6f5b..054bab9 100644
--- a/sh.c
+++ b/sh.c
@@ -66,7 +66,7 @@ runcmd(struct cmd *cmd)
if(cmd == 0)
exit();
-
+
switch(cmd->type){
default:
panic("runcmd");
@@ -120,7 +120,7 @@ runcmd(struct cmd *cmd)
wait();
wait();
break;
-
+
case BACK:
bcmd = (struct backcmd*)cmd;
if(fork1() == 0)
@@ -146,7 +146,7 @@ main(void)
{
static char buf[100];
int fd;
-
+
// Ensure that three file descriptors are open.
while((fd = open("console", O_RDWR)) >= 0){
if(fd >= 3){
@@ -154,7 +154,7 @@ main(void)
break;
}
}
-
+
// Read and run input commands.
while(getcmd(buf, sizeof(buf)) >= 0){
if(buf[0] == 'c' && buf[1] == 'd' && buf[2] == ' '){
@@ -182,7 +182,7 @@ int
fork1(void)
{
int pid;
-
+
pid = fork();
if(pid == -1)
panic("fork");
@@ -267,7 +267,7 @@ gettoken(char **ps, char *es, char **q, char **eq)
{
char *s;
int ret;
-
+
s = *ps;
while(s < es && strchr(whitespace, *s))
s++;
@@ -300,7 +300,7 @@ gettoken(char **ps, char *es, char **q, char **eq)
}
if(eq)
*eq = s;
-
+
while(s < es && strchr(whitespace, *s))
s++;
*ps = s;
@@ -311,7 +311,7 @@ int
peek(char **ps, char *es, char *toks)
{
char *s;
-
+
s = *ps;
while(s < es && strchr(whitespace, *s))
s++;
@@ -419,7 +419,7 @@ parseexec(char **ps, char *es)
int tok, argc;
struct execcmd *cmd;
struct cmd *ret;
-
+
if(peek(ps, es, "("))
return parseblock(ps, es);
@@ -458,7 +458,7 @@ nulterminate(struct cmd *cmd)
if(cmd == 0)
return 0;
-
+
switch(cmd->type){
case EXEC:
ecmd = (struct execcmd*)cmd;
@@ -477,7 +477,7 @@ nulterminate(struct cmd *cmd)
nulterminate(pcmd->left);
nulterminate(pcmd->right);
break;
-
+
case LIST:
lcmd = (struct listcmd*)cmd;
nulterminate(lcmd->left);
diff --git a/spinlock.c b/spinlock.c
index 1517171..a5f0b21 100644
--- a/spinlock.c
+++ b/spinlock.c
@@ -71,7 +71,7 @@ getcallerpcs(void *v, uint pcs[])
{
uint *ebp;
int i;
-
+
ebp = (uint*)v - 2;
for(i = 0; i < 10; i++){
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
@@ -99,7 +99,7 @@ void
pushcli(void)
{
int eflags;
-
+
eflags = readeflags();
cli();
if(cpu->ncli++ == 0)
diff --git a/spinlock.h b/spinlock.h
index fdda016..0a9d8e2 100644
--- a/spinlock.h
+++ b/spinlock.h
@@ -1,7 +1,7 @@
// Mutual exclusion lock.
struct spinlock {
uint locked; // Is the lock held?
-
+
// For debugging:
char *name; // Name of lock.
struct cpu *cpu; // The cpu holding the lock.
diff --git a/stressfs.c b/stressfs.c
index 6369400..c0a4743 100644
--- a/stressfs.c
+++ b/stressfs.c
@@ -44,6 +44,6 @@ main(int argc, char *argv[])
close(fd);
wait();
-
+
exit();
}
diff --git a/string.c b/string.c
index d066c18..a7cc61f 100644
--- a/string.c
+++ b/string.c
@@ -16,7 +16,7 @@ int
memcmp(const void *v1, const void *v2, uint n)
{
const uchar *s1, *s2;
-
+
s1 = v1;
s2 = v2;
while(n-- > 0){
@@ -69,7 +69,7 @@ char*
strncpy(char *s, const char *t, int n)
{
char *os;
-
+
os = s;
while(n-- > 0 && (*s++ = *t++) != 0)
;
@@ -83,7 +83,7 @@ char*
safestrcpy(char *s, const char *t, int n)
{
char *os;
-
+
os = s;
if(n <= 0)
return os;
diff --git a/syscall.c b/syscall.c
index 799ebc2..5d3be9d 100644
--- a/syscall.c
+++ b/syscall.c
@@ -55,7 +55,7 @@ int
argptr(int n, char **pp, int size)
{
int i;
-
+
if(argint(n, &i) < 0)
return -1;
if((uint)i >= proc->sz || (uint)i+size > proc->sz)
diff --git a/sysproc.c b/sysproc.c
index 027a5e5..6b585e0 100644
--- a/sysproc.c
+++ b/sysproc.c
@@ -61,7 +61,7 @@ sys_sleep(void)
{
int n;
uint ticks0;
-
+
if(argint(0, &n) < 0)
return -1;
acquire(&tickslock);
@@ -83,7 +83,7 @@ int
sys_uptime(void)
{
uint xticks;
-
+
acquire(&tickslock);
xticks = ticks;
release(&tickslock);
diff --git a/trap.c b/trap.c
index 3f80145..20ae62d 100644
--- a/trap.c
+++ b/trap.c
@@ -22,7 +22,7 @@ tvinit(void)
for(i = 0; i < 256; i++)
SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0);
SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);
-
+
initlock(&tickslock, "time");
}
@@ -77,7 +77,7 @@ trap(struct trapframe *tf)
cpu->id, tf->cs, tf->eip);
lapiceoi();
break;
-
+
//PAGEBREAK: 13
default:
if(proc == 0 || (tf->cs&3) == 0){
@@ -89,13 +89,13 @@ trap(struct trapframe *tf)
// In user space, assume process misbehaved.
cprintf("pid %d %s: trap %d err %d on cpu %d "
"eip 0x%x addr 0x%x--kill proc\n",
- proc->pid, proc->name, tf->trapno, tf->err, cpu->id, tf->eip,
+ proc->pid, proc->name, tf->trapno, tf->err, cpu->id, tf->eip,
rcr2());
proc->killed = 1;
}
// Force process exit if it has been killed and is in user space.
- // (If it is still executing in the kernel, let it keep running
+ // (If it is still executing in the kernel, let it keep running
// until it gets to the regular system call return.)
if(proc && proc->killed && (tf->cs&3) == DPL_USER)
exit();
diff --git a/uart.c b/uart.c
index 576e254..257384a 100644
--- a/uart.c
+++ b/uart.c
@@ -22,7 +22,7 @@ uartinit(void)
// Turn off the FIFO
outb(COM1+2, 0);
-
+
// 9600 baud, 8 data bits, 1 stop bit, parity off.
outb(COM1+3, 0x80); // Unlock divisor
outb(COM1+0, 115200/9600);
@@ -42,7 +42,7 @@ uartinit(void)
inb(COM1+0);
picenable(IRQ_COM1);
ioapicenable(IRQ_COM1, 0);
-
+
// Announce that we're here.
for(p="xv6...\n"; *p; p++)
uartputc(*p);
diff --git a/ulib.c b/ulib.c
index dbbcfcf..51a9e74 100644
--- a/ulib.c
+++ b/ulib.c
@@ -96,7 +96,7 @@ void*
memmove(void *vdst, void *vsrc, int n)
{
char *dst, *src;
-
+
dst = vdst;
src = vsrc;
while(n-- > 0)
diff --git a/usertests.c b/usertests.c
index 22a7bfb..458f8ed 100644
--- a/usertests.c
+++ b/usertests.c
@@ -539,7 +539,7 @@ fourfiles(void)
printf(1, "create failed\n");
exit();
}
-
+
memset(buf, '0'+pi, 512);
for(i = 0; i < 12; i++){
if((n = write(fd, buf, 500)) != 500){
@@ -882,7 +882,7 @@ linkunlink()
if(pid)
wait();
- else
+ else
exit();
printf(1, "linkunlink ok\n");
@@ -951,7 +951,7 @@ subdir(void)
}
write(fd, "ff", 2);
close(fd);
-
+
if(unlink("dd") >= 0){
printf(1, "unlink dd (non-empty dir) succeeded!\n");
exit();
@@ -1390,24 +1390,24 @@ forktest(void)
if(pid == 0)
exit();
}
-
+
if(n == 1000){
printf(1, "fork claimed to work 1000 times!\n");
exit();
}
-
+
for(; n > 0; n--){
if(wait() < 0){
printf(1, "wait stopped early\n");
exit();
}
}
-
+
if(wait() != -1){
printf(1, "wait got too many\n");
exit();
}
-
+
printf(1, "fork test OK\n");
}
@@ -1424,7 +1424,7 @@ sbrktest(void)
// can one sbrk() less than a page?
a = sbrk(0);
int i;
- for(i = 0; i < 5000; i++){
+ for(i = 0; i < 5000; i++){
b = sbrk(1);
if(b != a){
printf(stdout, "sbrk test failed %d %x %x\n", i, a, b);
@@ -1453,7 +1453,7 @@ sbrktest(void)
a = sbrk(0);
amt = (BIG) - (uint)a;
p = sbrk(amt);
- if (p != a) {
+ if (p != a) {
printf(stdout, "sbrk test failed to grow big address space; enough phys mem?\n");
exit();
}
@@ -1492,7 +1492,7 @@ sbrktest(void)
printf(stdout, "sbrk downsize failed, a %x c %x\n", a, c);
exit();
}
-
+
// can we read the kernel's memory?
for(a = (char*)(KERNBASE); a < (char*) (KERNBASE+2000000); a += 50000){
ppid = getpid();
diff --git a/vm.c b/vm.c
index 6c42ae5..16fb03b 100644
--- a/vm.c
+++ b/vm.c
@@ -32,7 +32,7 @@ seginit(void)
lgdt(c->gdt, sizeof(c->gdt));
loadgs(SEG_KCPU << 3);
-
+
// Initialize cpu-local storage.
cpu = c;
proc = 0;
@@ -56,7 +56,7 @@ walkpgdir(pde_t *pgdir, const void *va, int alloc)
// Make sure all those PTE_P bits are zero.
memset(pgtab, 0, PGSIZE);
// The permissions here are overly generous, but they can
- // be further restricted by the permissions in the page table
+ // be further restricted by the permissions in the page table
// entries, if necessary.
*pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U;
}
@@ -71,7 +71,7 @@ mappages(pde_t *pgdir, void *va, uint size, uint pa, int perm)
{
char *a, *last;
pte_t *pte;
-
+
a = (char*)PGROUNDDOWN((uint)va);
last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
for(;;){
@@ -93,7 +93,7 @@ mappages(pde_t *pgdir, void *va, uint size, uint pa, int perm)
// current process's page table during system calls and interrupts;
// page protection bits prevent user code from using the kernel's
// mappings.
-//
+//
// setupkvm() and exec() set up every page table like this:
//
// 0..KERNBASE: user memory (text+data+stack+heap), mapped to
@@ -101,7 +101,7 @@ mappages(pde_t *pgdir, void *va, uint size, uint pa, int perm)
// KERNBASE..KERNBASE+EXTMEM: mapped to 0..EXTMEM (for I/O space)
// KERNBASE+EXTMEM..data: mapped to EXTMEM..V2P(data)
// for the kernel's instructions and r/o data
-// data..KERNBASE+PHYSTOP: mapped to V2P(data)..PHYSTOP,
+// data..KERNBASE+PHYSTOP: mapped to V2P(data)..PHYSTOP,
// rw data + free physical memory
// 0xfe000000..0: mapped direct (devices such as ioapic)
//
@@ -136,7 +136,7 @@ setupkvm(void)
if (P2V(PHYSTOP) > (void*)DEVSPACE)
panic("PHYSTOP too high");
for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
- if(mappages(pgdir, k->virt, k->phys_end - k->phys_start,
+ if(mappages(pgdir, k->virt, k->phys_end - k->phys_start,
(uint)k->phys_start, k->perm) < 0)
return 0;
return pgdir;
@@ -181,7 +181,7 @@ void
inituvm(pde_t *pgdir, char *init, uint sz)
{
char *mem;
-
+
if(sz >= PGSIZE)
panic("inituvm: more than a page");
mem = kalloc();
diff --git a/x86.h b/x86.h
index 3949900..07312a5 100644
--- a/x86.h
+++ b/x86.h
@@ -121,7 +121,7 @@ static inline uint
xchg(volatile uint *addr, uint newval)
{
uint result;
-
+
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
"+m" (*addr), "=a" (result) :
@@ -139,7 +139,7 @@ rcr2(void)
}
static inline void
-lcr3(uint val)
+lcr3(uint val)
{
asm volatile("movl %0,%%cr3" : : "r" (val));
}
diff --git a/zombie.c b/zombie.c
index 077c02c..ee817da 100644
--- a/zombie.c
+++ b/zombie.c
@@ -1,4 +1,4 @@
-// Create a zombie process that
+// Create a zombie process that
// must be reparented at exit.
#include "types.h"