func: static void pmac_ide_writeb (void target_phys_addr_t addr, uint32_t val) MACIOIDEState * d = opaque ; addr = ( addr & 0xFFF ) >> 4; switch ( addr )  ide_ioport_write ( d -> ide_if , addr , val ); static void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val) IDEState * ide_if = opaque ; IDEState * s ; int unit , n ; addr &= 7; if ( addr != 7 && ( ide_if -> cur_drive -> status & ( BUSY_STAT | DRQ_STAT ) ) )  switch ( addr )  ide_if [ 0 ] . hob_feature = ide_if [ 0 ] . feature; ide_if [ 1 ] . hob_feature = ide_if [ 1 ] . feature; ide_if [ 0 ] . feature = val; ide_if [ 1 ] . feature = val; ide_if [ 0 ] . hob_nsector = ide_if [ 0 ] . nsector; ide_if [ 1 ] . hob_nsector = ide_if [ 1 ] . nsector; ide_if [ 0 ] . nsector = val; ide_if [ 1 ] . nsector = val; ide_if [ 0 ] . hob_sector = ide_if [ 0 ] . sector; ide_if [ 1 ] . hob_sector = ide_if [ 1 ] . sector; ide_if [ 0 ] . sector = val; ide_if [ 1 ] . sector = val; ide_if [ 0 ] . hob_lcyl = ide_if [ 0 ] . lcyl; ide_if [ 1 ] . hob_lcyl = ide_if [ 1 ] . lcyl; ide_if [ 0 ] . lcyl = val; ide_if [ 1 ] . lcyl = val; ide_if [ 0 ] . hob_hcyl = ide_if [ 0 ] . hcyl; ide_if [ 1 ] . hob_hcyl = ide_if [ 1 ] . hcyl; ide_if [ 0 ] . hcyl = val; ide_if [ 1 ] . hcyl = val; ide_if [ 0 ] . select = ( val & ~0x10 ) | 0xa0; ide_if [ 1 ] . select = ( val | 0x10 ) | 0xa0; unit = ( val >> 4 ) & 1; s = ide_if + unit; ide_if -> cur_drive = s; s = ide_if -> cur_drive; if ( ! s -> bs )  if ( ( s -> status & ( BUSY_STAT | DRQ_STAT ) ) && val != WIN_DEVICE_RESET )  switch ( val )  if ( s -> bs && ! s -> is_cdrom )  if ( ! s -> is_cf )  ide_identify ( s ); static void ide_identify(IDEState *s) if ( s -> identify_set )  memset ( s -> io_buffer , 0 , 512 ); p = ( uint16_t * ) s -> io_buffer; put_le16 ( p + 0 , 0x0040 ); put_le16 ( p + 1 , s -> cylinders ); put_le16 ( p + 3 , s -> heads ); put_le16 ( p + 4 , 512 * s -> sectors ); put_le16 ( p + 5 , 512 ); put_le16 ( p + 6 , s -> sectors ); padstr ( ( char * ) ( p + 10 ) , s -> drive_serial_str , 20 ); put_le16 ( p + 20 , 3 ); put_le16 ( p + 21 , 512 ); put_le16 ( p + 22 , 4 ); padstr ( ( char * ) ( p + 23 ) , QEMU_VERSION , 8 ); padstr ( ( char * ) ( p + 27 ) , "QEMU HARDDISK" , 40 ); put_le16 ( p + 47 , 0x8000 | MAX_MULT_SECTORS ); put_le16 ( p + 48 , 1 ); put_le16 ( p + 49 , ( 1 << 11 ) | ( 1 << 9 ) | ( 1 << 8 ) ); put_le16 ( p + 51 , 0x200 ); put_le16 ( p + 52 , 0x200 ); put_le16 ( p + 53 , 1 | ( 1 << 1 ) | ( 1 << 2 ) ); put_le16 ( p + 54 , s -> cylinders ); put_le16 ( p + 55 , s -> heads ); put_le16 ( p + 56 , s -> sectors ); oldsize = s -> cylinders * s -> heads * s -> sectors; put_le16 ( p + 57 , oldsize ); put_le16 ( p + 58 , oldsize >> 16 ); if ( s -> mult_sectors )  put_le16 ( p + 59 , 0x100 | s -> mult_sectors ); put_le16 ( p + 60 , s -> nb_sectors ); put_le16 ( p + 61 , s -> nb_sectors >> 16 ); put_le16 ( p + 62 , 0x07 ); put_le16 ( p + 63 , 0x07 ); put_le16 ( p + 65 , 120 ); put_le16 ( p + 66 , 120 ); put_le16 ( p + 67 , 120 ); put_le16 ( p + 68 , 120 ); put_le16 ( p + 80 , 0xf0 ); put_le16 ( p + 81 , 0x16 ); put_le16 ( p + 82 , ( 1 << 14 ) | ( 1 << 5 ) ); put_le16 ( p + 83 , ( 1 << 14 ) | ( 1 << 13 ) | ( 1 << 12 ) | ( 1 << 10 ) ); put_le16 ( p + 84 , ( 1 << 14 ) ); put_le16 ( p + 85 , ( 1 << 14 ) | ( s -> write_cache << 5 ) ); put_le16 ( p + 86 , ( 1 << 14 ) | ( 1 << 13 ) | ( 1 << 12 ) | ( 1 << 10 ) ); put_le16 ( p + 87 , ( 1 << 14 ) ); put_le16 ( p + 88 , 0x3f | ( 1 << 13 ) ); put_le16 ( p + 93 , 1 | ( 1 << 14 ) | 0x2000 ); put_le16 ( p + 100 , s -> nb_sectors ); put_le16 ( p + 101 , s -> nb_sectors >> 16 ); put_le16 ( p + 102 , s -> nb_sectors >> 32 ); put_le16 ( p + 103 , s -> nb_sectors >> 48 ); memcpy ( s -> identify_data , p , sizeof ( s -> identify_data ) ); s -> identify_set = 1; 