X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fdevices%2Fcdrom.h;h=ea4d9c5b24b0a13662715ce697a4760c6971f0d1;hb=c535b3199977444c3aa2c44b852cc82ce659c5ff;hp=4546f4fafa1023f1a6aaacbd7c53dd0a344a0c1b;hpb=c07f7f11e5d781b90f4d8876d12f3fc4e47309ad;p=palacios.git diff --git a/palacios/include/devices/cdrom.h b/palacios/include/devices/cdrom.h index 4546f4f..ea4d9c5 100644 --- a/palacios/include/devices/cdrom.h +++ b/palacios/include/devices/cdrom.h @@ -1,76 +1,78 @@ + /* - * Zheng Cui - * cuizheng@cs.unm.edu - * July 2008 + * This file is part of the Palacios Virtual Machine Monitor developed + * by the V3VEE Project with funding from the United States National + * Science Foundation and the Department of Energy. + * + * The V3VEE Project is a joint project between Northwestern University + * and the University of New Mexico. You can find out more at + * http://www.v3vee.org + * + * Copyright (c) 2008, Zheng Cui + * Copyright (c) 2008, The V3VEE Project + * All rights reserved. + * + * Author: Zheng Cui + * + * This is free software. You are permitted to use, + * redistribute, and modify it as specified in the file "V3VEE_LICENSE". */ -#ifndef __DEVICES_CDROM_H_ -#define __DEVICES_CDROM_H_ +#ifndef __DEVICES_CDROM_H__ +#define __DEVICES_CDROM_H__ -#include -typedef unsigned int rd_bool; -typedef uchar_t Bit8u; -typedef ushort_t Bit16u; -typedef uint_t Bit32u; -typedef ullong_t Bit64u; +#ifdef __V3VEE__ + +#include +#include +#include -#define uint8 Bit8u -#define uint16 Bit16u -#define uint32 Bit32u -struct cdrom_interface; -struct cdrom_ops { - - void (*init)(struct cdrom_interface *cdrom); - /* - * Load CD-ROM. Returns false if CD is not ready. - */ - rd_bool (*insert_cdrom)(struct cdrom_interface *cdrom, char *dev /*= NULL*/); - /* - * Logically eject the CD. - */ - void (*eject_cdrom)(struct cdrom_interface *cdrom); +struct cdrom_ops { + /* + * Load CD-ROM. Returns false if CD is not ready. + */ + rd_bool (*insert_cdrom)(void * private_data); + + /* + * Logically eject the CD. + */ + void (*eject_cdrom)(void * private_data); - /* - * Read CD TOC. Returns false if start track is out of bounds. - */ - rd_bool (*read_toc)(struct cdrom_interface *cdrom, uint8* buf, int* length, rd_bool msf, int start_track); + /* + * Read CD TOC. Returns false if start track is out of bounds. + */ + rd_bool (*read_toc)(void * private_data, uchar_t * buf, int * length, rd_bool msf, int start_track); - /* - * Return CD-ROM capacity (in 2048 byte frames) - */ - uint32 (*capacity)(struct cdrom_interface *cdrom); + /* + * Return CD-ROM capacity (in 2048 byte frames) + */ + uint32_t (*capacity)(void * private_data); - /* - * Read a single block from the CD - */ - void (*read_block)(struct cdrom_interface *cdrom, uint8* buf, int lba); + /* + * Read a single block from the CD + */ + void (*read_block)(void * private_data, uchar_t * buf, int lba); - /* - * Start (spin up) the CD. - */ - int (*start_cdrom)(struct cdrom_interface *cdrom); + /* + * Start (spin up) the CD. + */ + int (*start_cdrom)(void * private_data); + + void (*set_LBA)(void * private_data, uchar_t lba); }; -struct cdrom_interface { - struct cdrom_ops ops; - ulong_t fd; //memory address - ulong_t capacity_B; - ulong_t head; //current position +struct vm_device * v3_create_cdrom(struct vm_device * ramdisk_dev, void * ramdisk, uint_t ramdisk_size); - uchar_t lba; - char *path; //for ramdisk, NULL - int using_file; //no -}; -void init_cdrom(struct cdrom_interface *cdrom); +#endif // !__V3VEE__ #endif