projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Comments and a bit of initialization order cleanup.
[pintos-anon]
/
src
/
devices
/
disk.h
diff --git
a/src/devices/disk.h
b/src/devices/disk.h
index 9d5216418e02128cf62ecd45a1d210a1cd1c9ece..3bcbb9a10612d223434bae8b81bd75b72de3d4d4 100644
(file)
--- a/
src/devices/disk.h
+++ b/
src/devices/disk.h
@@
-1,18
+1,26
@@
-#ifndef
HEADER
_DISK_H
-#define
HEADER_DISK_H 1
+#ifndef
DEVICES
_DISK_H
+#define
DEVICES_DISK_H
#include <inttypes.h>
#include <stdint.h>
#include <inttypes.h>
#include <stdint.h>
+/* Size of a disk sector in bytes. */
#define DISK_SECTOR_SIZE 512
#define DISK_SECTOR_SIZE 512
-typedef uint32_t disk_sector_no;
-#define PRDSNu PRIu32 /* For use with printk(). */
+/* Index of a disk sector within a disk.
+ Good enough for disks up to 2 TB. */
+typedef uint32_t disk_sector_t;
+
+/* Format specifier for printf(), e.g.:
+ printf ("sector=%"PRDSNu"\n", sector); */
+#define PRDSNu PRIu32
void disk_init (void);
void disk_init (void);
+void disk_print_stats (void);
+
struct disk *disk_get (int chan_no, int dev_no);
struct disk *disk_get (int chan_no, int dev_no);
-disk_sector_
no
disk_size (struct disk *);
-void disk_read (struct disk *, disk_sector_
no
, void *);
-void disk_write (struct disk *, disk_sector_
no
, const void *);
+disk_sector_
t
disk_size (struct disk *);
+void disk_read (struct disk *, disk_sector_
t
, void *);
+void disk_write (struct disk *, disk_sector_
t
, const void *);
-#endif /* disk.h */
+#endif /* d
evices/d
isk.h */