Fix build
Actually some systems don't define PAGE_SIZE. Fixes build breakage
by f7736b91c4.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
			
			
This commit is contained in:
		
							parent
							
								
									f7736b91c4
								
							
						
					
					
						commit
						6450a334c4
					
				| 
						 | 
				
			
			@ -34,6 +34,8 @@
 | 
			
		|||
 | 
			
		||||
#include <hw/ide/internal.h>
 | 
			
		||||
 | 
			
		||||
#define IDE_PAGE_SIZE 4096
 | 
			
		||||
 | 
			
		||||
static int smart_attributes[][5] = {
 | 
			
		||||
    /* id,  flags, val, wrst, thrsh */
 | 
			
		||||
    { 0x01, 0x03, 0x64, 0x64, 0x06}, /* raw read */
 | 
			
		||||
| 
						 | 
				
			
			@ -433,13 +435,13 @@ static int dma_buf_prepare(BMDMAState *bm, int is_write)
 | 
			
		|||
    } prd;
 | 
			
		||||
    int l, len;
 | 
			
		||||
 | 
			
		||||
    qemu_sglist_init(&s->sg, s->nsector / (PAGE_SIZE / 512) + 1);
 | 
			
		||||
    qemu_sglist_init(&s->sg, s->nsector / (IDE_PAGE_SIZE / 512) + 1);
 | 
			
		||||
    s->io_buffer_size = 0;
 | 
			
		||||
    for(;;) {
 | 
			
		||||
        if (bm->cur_prd_len == 0) {
 | 
			
		||||
            /* end of table (with a fail safe of one page) */
 | 
			
		||||
            if (bm->cur_prd_last ||
 | 
			
		||||
                (bm->cur_addr - bm->addr) >= PAGE_SIZE)
 | 
			
		||||
                (bm->cur_addr - bm->addr) >= IDE_PAGE_SIZE)
 | 
			
		||||
                return s->io_buffer_size != 0;
 | 
			
		||||
            cpu_physical_memory_read(bm->cur_addr, (uint8_t *)&prd, 8);
 | 
			
		||||
            bm->cur_addr += 8;
 | 
			
		||||
| 
						 | 
				
			
			@ -522,7 +524,7 @@ static int dma_buf_rw(BMDMAState *bm, int is_write)
 | 
			
		|||
        if (bm->cur_prd_len == 0) {
 | 
			
		||||
            /* end of table (with a fail safe of one page) */
 | 
			
		||||
            if (bm->cur_prd_last ||
 | 
			
		||||
                (bm->cur_addr - bm->addr) >= PAGE_SIZE)
 | 
			
		||||
                (bm->cur_addr - bm->addr) >= IDE_PAGE_SIZE)
 | 
			
		||||
                return 0;
 | 
			
		||||
            cpu_physical_memory_read(bm->cur_addr, (uint8_t *)&prd, 8);
 | 
			
		||||
            bm->cur_addr += 8;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue