X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Finclude%2Fdevices%2Fcdrom.h;fp=palacios%2Finclude%2Fdevices%2Fcdrom.h;h=c4f5b466e83dd3b85a0973405122f93c92b5b9d2;hp=0000000000000000000000000000000000000000;hb=ddc16b0737cf58f7aa90a69c6652cdf4090aec51;hpb=626595465a2c6987606a6bc697df65130ad8c2d3 diff --git a/palacios/include/devices/cdrom.h b/palacios/include/devices/cdrom.h new file mode 100644 index 0000000..c4f5b46 --- /dev/null +++ b/palacios/include/devices/cdrom.h @@ -0,0 +1,78 @@ + +/* + * 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__ + + +#ifdef __V3VEE__ + +#include +#include +#include + + + + + +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)(void * private_data, uchar_t * buf, int * length, rd_bool msf, int start_track); + + /* + * Return CD-ROM capacity (in 2048 byte frames) + */ + uint32_t (*capacity)(void * private_data); + + /* + * 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)(void * private_data); + + void (*set_LBA)(void * private_data, uchar_t lba); +}; + + + + +struct vm_device * v3_create_cdrom(struct vm_device * ramdisk_dev, void * ramdisk, uint_t ramdisk_size); + + + +#endif // !__V3VEE__ + +#endif