2067 |
|
|
2068 |
memset(s->io_buffer, 0, 512); |
memset(s->io_buffer, 0, 512); |
2069 |
p = (uint16_t *)s->io_buffer; |
p = (uint16_t *)s->io_buffer; |
2070 |
stw(p + 0, 0x0040); |
stw_raw(p + 0, 0x0040); |
2071 |
stw(p + 1, s->cylinders); |
stw_raw(p + 1, s->cylinders); |
2072 |
stw(p + 3, s->heads); |
stw_raw(p + 3, s->heads); |
2073 |
stw(p + 4, 512 * s->sectors); /* sectors */ |
stw_raw(p + 4, 512 * s->sectors); /* sectors */ |
2074 |
stw(p + 5, 512); /* sector size */ |
stw_raw(p + 5, 512); /* sector size */ |
2075 |
stw(p + 6, s->sectors); |
stw_raw(p + 6, s->sectors); |
2076 |
stw(p + 20, 3); /* buffer type */ |
stw_raw(p + 20, 3); /* buffer type */ |
2077 |
stw(p + 21, 512); /* cache size in sectors */ |
stw_raw(p + 21, 512); /* cache size in sectors */ |
2078 |
stw(p + 22, 4); /* ecc bytes */ |
stw_raw(p + 22, 4); /* ecc bytes */ |
2079 |
padstr((uint8_t *)(p + 27), "QEMU HARDDISK", 40); |
padstr((uint8_t *)(p + 27), "QEMU HARDDISK", 40); |
2080 |
#if MAX_MULT_SECTORS > 1 |
#if MAX_MULT_SECTORS > 1 |
2081 |
stw(p + 47, MAX_MULT_SECTORS); |
stw_raw(p + 47, MAX_MULT_SECTORS); |
2082 |
#endif |
#endif |
2083 |
stw(p + 48, 1); /* dword I/O */ |
stw_raw(p + 48, 1); /* dword I/O */ |
2084 |
stw(p + 49, 1 << 9); /* LBA supported, no DMA */ |
stw_raw(p + 49, 1 << 9); /* LBA supported, no DMA */ |
2085 |
stw(p + 51, 0x200); /* PIO transfer cycle */ |
stw_raw(p + 51, 0x200); /* PIO transfer cycle */ |
2086 |
stw(p + 52, 0x200); /* DMA transfer cycle */ |
stw_raw(p + 52, 0x200); /* DMA transfer cycle */ |
2087 |
stw(p + 54, s->cylinders); |
stw_raw(p + 54, s->cylinders); |
2088 |
stw(p + 55, s->heads); |
stw_raw(p + 55, s->heads); |
2089 |
stw(p + 56, s->sectors); |
stw_raw(p + 56, s->sectors); |
2090 |
oldsize = s->cylinders * s->heads * s->sectors; |
oldsize = s->cylinders * s->heads * s->sectors; |
2091 |
stw(p + 57, oldsize); |
stw_raw(p + 57, oldsize); |
2092 |
stw(p + 58, oldsize >> 16); |
stw_raw(p + 58, oldsize >> 16); |
2093 |
if (s->mult_sectors) |
if (s->mult_sectors) |
2094 |
stw(p + 59, 0x100 | s->mult_sectors); |
stw_raw(p + 59, 0x100 | s->mult_sectors); |
2095 |
stw(p + 60, s->nb_sectors); |
stw_raw(p + 60, s->nb_sectors); |
2096 |
stw(p + 61, s->nb_sectors >> 16); |
stw_raw(p + 61, s->nb_sectors >> 16); |
2097 |
stw(p + 80, (1 << 1) | (1 << 2)); |
stw_raw(p + 80, (1 << 1) | (1 << 2)); |
2098 |
stw(p + 82, (1 << 14)); |
stw_raw(p + 82, (1 << 14)); |
2099 |
stw(p + 83, (1 << 14)); |
stw_raw(p + 83, (1 << 14)); |
2100 |
stw(p + 84, (1 << 14)); |
stw_raw(p + 84, (1 << 14)); |
2101 |
stw(p + 85, (1 << 14)); |
stw_raw(p + 85, (1 << 14)); |
2102 |
stw(p + 86, 0); |
stw_raw(p + 86, 0); |
2103 |
stw(p + 87, (1 << 14)); |
stw_raw(p + 87, (1 << 14)); |
2104 |
} |
} |
2105 |
|
|
2106 |
static inline void ide_abort_command(IDEState *s) |
static inline void ide_abort_command(IDEState *s) |
3275 |
ds->dpy_refresh = dumb_refresh; |
ds->dpy_refresh = dumb_refresh; |
3276 |
} |
} |
3277 |
|
|
3278 |
|
#if !defined(CONFIG_SOFTMMU) |
3279 |
/***********************************************************/ |
/***********************************************************/ |
3280 |
/* cpu signal handler */ |
/* cpu signal handler */ |
3281 |
static void host_segv_handler(int host_signum, siginfo_t *info, |
static void host_segv_handler(int host_signum, siginfo_t *info, |
3286 |
term_exit(); |
term_exit(); |
3287 |
abort(); |
abort(); |
3288 |
} |
} |
3289 |
|
#endif |
3290 |
|
|
3291 |
static int timer_irq_pending; |
static int timer_irq_pending; |
3292 |
static int timer_irq_count; |
static int timer_irq_count; |
3809 |
/* setup cpu signal handlers for MMU / self modifying code handling */ |
/* setup cpu signal handlers for MMU / self modifying code handling */ |
3810 |
sigfillset(&act.sa_mask); |
sigfillset(&act.sa_mask); |
3811 |
act.sa_flags = SA_SIGINFO; |
act.sa_flags = SA_SIGINFO; |
3812 |
|
#if !defined(CONFIG_SOFTMMU) |
3813 |
act.sa_sigaction = host_segv_handler; |
act.sa_sigaction = host_segv_handler; |
3814 |
sigaction(SIGSEGV, &act, NULL); |
sigaction(SIGSEGV, &act, NULL); |
3815 |
sigaction(SIGBUS, &act, NULL); |
sigaction(SIGBUS, &act, NULL); |
3816 |
|
#endif |
3817 |
|
|
3818 |
act.sa_sigaction = host_alarm_handler; |
act.sa_sigaction = host_alarm_handler; |
3819 |
sigaction(SIGALRM, &act, NULL); |
sigaction(SIGALRM, &act, NULL); |