X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Framdisk.c;h=cb92ca9a8fc28e875f29b1c130e6a3a777d70ce1;hb=bc7e32ac62565b9f2aca07acdfa430aa3d444e8c;hp=53116d4348fb305b72ed5d42ce29e77718d80f89;hpb=4bc3ee757b44d3e466fd89e348106c47fa5511ee;p=palacios-OLD.git diff --git a/palacios/src/devices/ramdisk.c b/palacios/src/devices/ramdisk.c index 53116d4..cb92ca9 100644 --- a/palacios/src/devices/ramdisk.c +++ b/palacios/src/devices/ramdisk.c @@ -319,7 +319,6 @@ static void rd_lower_irq(struct vm_device *dev, struct channel_t * channel); #ifdef DEBUG_RAMDISK static void rd_print_state(struct ramdisk_t *ramdisk); -static int check_bit_fields(struct controller_t * controller); #endif @@ -362,14 +361,6 @@ int v3_ramdisk_register_cdrom(struct vm_device * dev, uint_t busID, uint_t drive drive->private_data = private_data; - -#ifdef DEBUG_RAMDISK - if (check_bit_fields(controller) == INTR_REASON_BIT_ERR) { - PrintError("interrupt reason: bit field error\n"); - return INTR_REASON_BIT_ERR; - } -#endif - controller->sector_count = 0; drive->cdrom.cd = cd; @@ -451,8 +442,8 @@ static Bit32u rd_init_hardware(struct ramdisk_t *ramdisk) { strcat ((char*)(drive->model_no), " "); } - }//for device - }//for channel + } + } #ifdef DEBUG_RAMDISK rd_print_state(ramdisk); @@ -1933,11 +1924,11 @@ int handle_atapi_packet_command(struct vm_device * dev, struct channel_t * chann } case 0x42: // read sub-channel { - //bool msf = get_packet_field(channel,1, 1, 1); - bool sub_q = get_packet_field(channel,2, 6, 1); - //uint8_t data_format = get_packet_byte(channel,3); - //uint8_t track_number = get_packet_byte(channel,6); - uint16_t alloc_length = get_packet_word(channel,7); + //bool msf = get_packet_field(channel, 1, 1, 1); + bool sub_q = get_packet_field(channel, 2, 6, 1); + //uint8_t data_format = get_packet_byte(channel, 3); + //uint8_t track_number = get_packet_byte(channel, 6); + uint16_t alloc_length = get_packet_word(channel, 7); /* @@ -2174,7 +2165,7 @@ void rd_identify_ATAPI_drive(struct vm_device * dev, struct channel_t * channel) drive->id_drive[i] = 0; } - for (i = 0; i < strlen(firmware)/2; i++) { + for (i = 0; i < strlen(firmware) / 2; i++) { drive->id_drive[23 + i] = ((firmware[i * 2] << 8) | (firmware[(i * 2) + 1])); } @@ -2184,6 +2175,7 @@ void rd_identify_ATAPI_drive(struct vm_device * dev, struct channel_t * channel) drive->id_drive[27 + i] = ((drive->model_no[i * 2] << 8) | (drive->model_no[(i * 2) + 1])); } + V3_ASSERT((27 + i) == 47); drive->id_drive[47] = 0; @@ -2574,35 +2566,4 @@ static void rd_print_state(struct ramdisk_t * ramdisk) { } - - -static int check_bit_fields(struct controller_t * controller) { - //Check bit fields - controller->sector_count = 0; - controller->interrupt_reason.c_d = 1; - if (controller->sector_count != 0x01) { - return INTR_REASON_BIT_ERR; - } - - controller->sector_count = 0; - controller->interrupt_reason.i_o = 1; - if (controller->sector_count != 0x02) { - return INTR_REASON_BIT_ERR; - } - - controller->sector_count = 0; - controller->interrupt_reason.rel = 1; - if (controller->sector_count != 0x04) { - return INTR_REASON_BIT_ERR; - } - - controller->sector_count = 0; - controller->interrupt_reason.tag = 3; - if (controller->sector_count != 0x18) { - return INTR_REASON_BIT_ERR; - } - - return 0; -} - #endif