Revision e9a1ab19

b/cpu-all.h
848 848
                                  unsigned long size,
849 849
                                  unsigned long phys_offset);
850 850
uint32_t cpu_get_physical_page_desc(target_phys_addr_t addr);
851
ram_addr_t qemu_ram_alloc(unsigned int size);
852
void qemu_ram_free(ram_addr_t addr);
851 853
int cpu_register_io_memory(int io_index,
852 854
                           CPUReadMemoryFunc **mem_read,
853 855
                           CPUWriteMemoryFunc **mem_write,
b/exec.c
82 82
int phys_ram_fd;
83 83
uint8_t *phys_ram_base;
84 84
uint8_t *phys_ram_dirty;
85
static ram_addr_t phys_ram_alloc_offset = 0;
85 86

  
86 87
CPUState *first_cpu;
87 88
/* current CPU in the current thread. It is only valid inside
......
1812 1813
    return p->phys_offset;
1813 1814
}
1814 1815

  
1816
/* XXX: better than nothing */
1817
ram_addr_t qemu_ram_alloc(unsigned int size)
1818
{
1819
    ram_addr_t addr;
1820
    if ((phys_ram_alloc_offset + size) >= phys_ram_size) {
1821
        fprintf(stderr, "Not enough memory (requested_size = %u, max memory = %d)\n", 
1822
                size, phys_ram_size);
1823
        abort();
1824
    }
1825
    addr = phys_ram_alloc_offset;
1826
    phys_ram_alloc_offset = TARGET_PAGE_ALIGN(phys_ram_alloc_offset + size);
1827
    return addr;
1828
}
1829

  
1830
void qemu_ram_free(ram_addr_t addr)
1831
{
1832
}
1833

  
1815 1834
static uint32_t unassigned_mem_readb(void *opaque, target_phys_addr_t addr)
1816 1835
{
1817 1836
#ifdef DEBUG_UNASSIGNED

Also available in: Unified diff