projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f583493
)
Tweak.
author
Ben Pfaff
<blp@cs.stanford.edu>
Wed, 1 Sep 2004 03:56:22 +0000
(
03:56
+0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Wed, 1 Sep 2004 03:56:22 +0000
(
03:56
+0000)
src/devices/disk.c
patch
|
blob
|
history
diff --git
a/src/devices/disk.c
b/src/devices/disk.c
index 1a50969df20fd772c076349446dd9fcadcab9fa0..2381c57a045284762d29652efd7896e02f0b829a 100644
(file)
--- a/
src/devices/disk.c
+++ b/
src/devices/disk.c
@@
-46,7
+46,7
@@
/* An ATA device. */
struct disk
{
/* An ATA device. */
struct disk
{
- char name[8]; /* e.g. "hd0:1". */
+ char name[8]; /*
Name,
e.g. "hd0:1". */
struct channel *channel; /* Channel disk is on. */
int dev_no; /* Device 0 or 1 for master or slave. */
struct channel *channel; /* Channel disk is on. */
int dev_no; /* Device 0 or 1 for master or slave. */
@@
-58,8
+58,8
@@
struct disk
Each channel can control up to two disks. */
struct channel
{
Each channel can control up to two disks. */
struct channel
{
- char name[8]; /*
e.g. "hd0"
*/
- uint16_t reg_base; /*
0x1f0 for hd0, 0x170 for hd1
. */
+ char name[8]; /*
Name, e.g. "hd0".
*/
+ uint16_t reg_base; /*
Base I/O port
. */
uint8_t irq; /* Interrupt in use. */
struct lock lock; /* Must acquire to access the controller. */
uint8_t irq; /* Interrupt in use. */
struct lock lock; /* Must acquire to access the controller. */
@@
-71,8
+71,8
@@
struct channel
};
/* We support the two "legacy" ATA channels found in a standard PC. */
};
/* We support the two "legacy" ATA channels found in a standard PC. */
-#define CHANNEL_CNT
(sizeof channels / sizeof *channels)
-static struct channel channels[
2
];
+#define CHANNEL_CNT
2
+static struct channel channels[
CHANNEL_CNT
];
static void reset_channel (struct channel *);
static bool check_device_type (struct disk *);
static void reset_channel (struct channel *);
static bool check_device_type (struct disk *);