diff options
author | rsc <rsc> | 2009-03-08 22:07:13 +0000 |
---|---|---|
committer | rsc <rsc> | 2009-03-08 22:07:13 +0000 |
commit | 2157576107d6e81c643e14e134b60b8ae519c256 (patch) | |
tree | 88ff770d321b4b2ef1ef1fcc0e17508ede6001bf /ide.c | |
parent | b7f653dc49dd4af29a3b7bdd66cd712bea166623 (diff) | |
download | xv6-labs-2157576107d6e81c643e14e134b60b8ae519c256.tar.gz xv6-labs-2157576107d6e81c643e14e134b60b8ae519c256.tar.bz2 xv6-labs-2157576107d6e81c643e14e134b60b8ae519c256.zip |
be consistent: no underscores in function names
Diffstat (limited to 'ide.c')
-rw-r--r-- | ide.c | 34 |
1 files changed, 17 insertions, 17 deletions
@@ -26,11 +26,11 @@ static struct spinlock ide_lock; static struct buf *ide_queue; static int disk_1_present; -static void ide_start_request(); +static void idestart(struct buf*); // Wait for IDE disk to become ready. static int -ide_wait_ready(int check_error) +idewait(int check_error) { int r; @@ -42,14 +42,14 @@ ide_wait_ready(int check_error) } void -ide_init(void) +ideinit(void) { int i; initlock(&ide_lock, "ide"); - pic_enable(IRQ_IDE); - ioapic_enable(IRQ_IDE, ncpu - 1); - ide_wait_ready(0); + picenable(IRQ_IDE); + ioapicenable(IRQ_IDE, ncpu - 1); + idewait(0); // Check if disk 1 is present outb(0x1f6, 0xe0 | (1<<4)); @@ -66,12 +66,12 @@ ide_init(void) // Start the request for b. Caller must hold ide_lock. static void -ide_start_request(struct buf *b) +idestart(struct buf *b) { if(b == 0) - panic("ide_start_request"); + panic("idestart"); - ide_wait_ready(0); + idewait(0); outb(0x3f6, 0); // generate interrupt outb(0x1f2, 1); // number of sectors outb(0x1f3, b->sector & 0xff); @@ -88,7 +88,7 @@ ide_start_request(struct buf *b) // Interrupt handler. void -ide_intr(void) +ideintr(void) { struct buf *b; @@ -99,7 +99,7 @@ ide_intr(void) } // Read data if needed. - if(!(b->flags & B_DIRTY) && ide_wait_ready(1) >= 0) + if(!(b->flags & B_DIRTY) && idewait(1) >= 0) insl(0x1f0, b->data, 512/4); // Wake process waiting for this buf. @@ -109,7 +109,7 @@ ide_intr(void) // Start disk on next buf in queue. if((ide_queue = b->qnext) != 0) - ide_start_request(ide_queue); + idestart(ide_queue); release(&ide_lock); } @@ -119,16 +119,16 @@ ide_intr(void) // 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 -ide_rw(struct buf *b) +iderw(struct buf *b) { struct buf **pp; if(!(b->flags & B_BUSY)) - panic("ide_rw: buf not busy"); + panic("iderw: buf not busy"); if((b->flags & (B_VALID|B_DIRTY)) == B_VALID) - panic("ide_rw: nothing to do"); + panic("iderw: nothing to do"); if(b->dev != 0 && !disk_1_present) - panic("ide disk 1 not present"); + panic("idrw: ide disk 1 not present"); acquire(&ide_lock); @@ -140,7 +140,7 @@ ide_rw(struct buf *b) // Start disk if necessary. if(ide_queue == b) - ide_start_request(b); + idestart(b); // Wait for request to finish. // Assuming will not sleep too long: ignore cp->killed. |