Changeset View
Changeset View
Standalone View
Standalone View
head/sys/boot/powerpc/kboot/hostdisk.c
Show All 27 Lines | |||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <stdarg.h> | #include <stdarg.h> | ||||
#include "bootstrap.h" | #include "bootstrap.h" | ||||
#include "host_syscall.h" | #include "host_syscall.h" | ||||
static int hostdisk_init(void); | static int hostdisk_init(void); | ||||
static int hostdisk_strategy(void *devdata, int flag, daddr_t dblk, | static int hostdisk_strategy(void *devdata, int flag, daddr_t dblk, | ||||
size_t size, char *buf, size_t *rsize); | size_t offset, size_t size, char *buf, size_t *rsize); | ||||
static int hostdisk_open(struct open_file *f, ...); | static int hostdisk_open(struct open_file *f, ...); | ||||
static int hostdisk_close(struct open_file *f); | static int hostdisk_close(struct open_file *f); | ||||
static int hostdisk_ioctl(struct open_file *f, u_long cmd, void *data); | static int hostdisk_ioctl(struct open_file *f, u_long cmd, void *data); | ||||
static void hostdisk_print(int verbose); | static void hostdisk_print(int verbose); | ||||
struct devsw hostdisk = { | struct devsw hostdisk = { | ||||
"/dev", | "/dev", | ||||
DEVT_DISK, | DEVT_DISK, | ||||
hostdisk_init, | hostdisk_init, | ||||
hostdisk_strategy, | hostdisk_strategy, | ||||
hostdisk_open, | hostdisk_open, | ||||
hostdisk_close, | hostdisk_close, | ||||
hostdisk_ioctl, | hostdisk_ioctl, | ||||
hostdisk_print, | hostdisk_print, | ||||
}; | }; | ||||
static int | static int | ||||
hostdisk_init(void) | hostdisk_init(void) | ||||
{ | { | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
hostdisk_strategy(void *devdata, int flag, daddr_t dblk, size_t size, | hostdisk_strategy(void *devdata, int flag, daddr_t dblk, size_t offset, | ||||
char *buf, size_t *rsize) | size_t size, char *buf, size_t *rsize) | ||||
{ | { | ||||
struct devdesc *desc = devdata; | struct devdesc *desc = devdata; | ||||
daddr_t pos; | daddr_t pos; | ||||
int n; | int n; | ||||
pos = dblk * 512; | pos = dblk * 512; | ||||
if (host_seek(desc->d_unit, pos, 0) < 0) { | if (host_seek(desc->d_unit, pos, 0) < 0) { | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |