CS318 - Pintos
Pintos source browser for JHU CS318 course
|
Go to the documentation of this file. 1 #ifndef DEVICES_BLOCK_H
2 #define DEVICES_BLOCK_H
11 #define BLOCK_SECTOR_SIZE 512
void block_write(struct block *, block_sector_t, const void *)
Write sector SECTOR to BLOCK from BUFFER, which must contain BLOCK_SECTOR_SIZE bytes.
Owned by non-Pintos operating system.
void block_print_stats(void)
Statistics.
Lower-level interface to block device drivers.
void(* read)(void *aux, block_sector_t, void *buffer)
Number of Pintos block types.
block_sector_t size
Size in sectors.
uint32_t block_sector_t
Index of a block device sector.
"Raw" device with unidentified contents.
struct block * block_first(void)
Returns the first block device in kernel probe order, or a null pointer if no block devices are regis...
void block_set_role(enum block_type, struct block *)
Assigns BLOCK the given ROLE.
const char * block_type_name(enum block_type)
Returns a human-readable name for the given block device TYPE.
const char * block_name(struct block *)
Returns BLOCK's name (e.g.
void(* write)(void *aux, block_sector_t, const void *buffer)
block_type
Type of a block device.
struct block * block_register(const char *name, enum block_type, const char *extra_info, block_sector_t size, const struct block_operations *, void *aux)
devices/block.h
void * aux
Extra data owned by driver.
struct block * block_get_by_name(const char *name)
Returns the block device with the given NAME, or a null pointer if no block device has that name.
struct block * block_get_role(enum block_type)
Finding block devices.
void block_read(struct block *, block_sector_t, void *)
Reads sector SECTOR from BLOCK into BUFFER, which must have room for BLOCK_SECTOR_SIZE bytes.
block_sector_t block_size(struct block *)
Block device operations.
struct block * block_next(struct block *)
Returns the block device following BLOCK in kernel probe order, or a null pointer if BLOCK is the las...