Revision 6450a334 hw/ide/core.c

b/hw/ide/core.c
34 34

  
35 35
#include <hw/ide/internal.h>
36 36

  
37
#define IDE_PAGE_SIZE 4096
38

  
37 39
static int smart_attributes[][5] = {
38 40
    /* id,  flags, val, wrst, thrsh */
39 41
    { 0x01, 0x03, 0x64, 0x64, 0x06}, /* raw read */
......
433 435
    } prd;
434 436
    int l, len;
435 437

  
436
    qemu_sglist_init(&s->sg, s->nsector / (PAGE_SIZE / 512) + 1);
438
    qemu_sglist_init(&s->sg, s->nsector / (IDE_PAGE_SIZE / 512) + 1);
437 439
    s->io_buffer_size = 0;
438 440
    for(;;) {
439 441
        if (bm->cur_prd_len == 0) {
440 442
            /* end of table (with a fail safe of one page) */
441 443
            if (bm->cur_prd_last ||
442
                (bm->cur_addr - bm->addr) >= PAGE_SIZE)
444
                (bm->cur_addr - bm->addr) >= IDE_PAGE_SIZE)
443 445
                return s->io_buffer_size != 0;
444 446
            cpu_physical_memory_read(bm->cur_addr, (uint8_t *)&prd, 8);
445 447
            bm->cur_addr += 8;
......
522 524
        if (bm->cur_prd_len == 0) {
523 525
            /* end of table (with a fail safe of one page) */
524 526
            if (bm->cur_prd_last ||
525
                (bm->cur_addr - bm->addr) >= PAGE_SIZE)
527
                (bm->cur_addr - bm->addr) >= IDE_PAGE_SIZE)
526 528
                return 0;
527 529
            cpu_physical_memory_read(bm->cur_addr, (uint8_t *)&prd, 8);
528 530
            bm->cur_addr += 8;

Also available in: Unified diff