symbian-qemu-0.9.1-12/qemu-symbian-svp/devtree.h
changeset 1 2fb8b9db1c86
equal deleted inserted replaced
0:ffa851df0825 1:2fb8b9db1c86
       
     1 #include "hw/hw.h"
       
     2 
       
     3 typedef struct QEMUDeviceClass QEMUDeviceClass;
       
     4 typedef struct QEMUDevice QEMUDevice;
       
     5 
       
     6 typedef void (*QDEVCreateFn)(QEMUDevice *);
       
     7 
       
     8 extern QEMUDeviceClass *cpu_device_class;
       
     9 
       
    10 extern const void *machine_devtree;
       
    11 extern int machine_devtree_size;
       
    12 
       
    13 typedef struct {
       
    14     target_phys_addr_t base;
       
    15     ram_addr_t size;
       
    16 } devtree_ram_region;
       
    17 
       
    18 extern devtree_ram_region *devtree_ram_map;
       
    19 extern int devtree_ram_map_size;
       
    20 
       
    21 void register_devices(void);
       
    22 void cpu_device_register(void);
       
    23 void cpu_bootstrap(const char *kernel_filename, const char *kernel_cmdline,
       
    24                    const char *initrd_filename);
       
    25 
       
    26 int devtree_get_config_int(const char * name, int def);
       
    27 
       
    28 QEMUDeviceClass *qdev_new(const char *name, QDEVCreateFn create, int nirq);
       
    29 void qdev_add_chardev(QEMUDeviceClass *dc);
       
    30 void qdev_add_registers(QEMUDeviceClass *dc, CPUReadMemoryFunc **mem_read,
       
    31                         CPUWriteMemoryFunc **mem_write,
       
    32                         target_phys_addr_t mem_size);
       
    33 void qdev_add_property_string(QEMUDeviceClass *dc, const char *name,
       
    34                               const char *def);
       
    35 void qdev_add_property_int(QEMUDeviceClass *dc, const char *name, int def);
       
    36 void qdev_add_savevm(QEMUDeviceClass *dc, int ver,
       
    37                      SaveStateHandler *save_state,
       
    38                      LoadStateHandler *load_state);
       
    39 void qdev_add_class_opaque(QEMUDeviceClass *dc, void *opaque);
       
    40 
       
    41 void qdev_set_irq_level(QEMUDevice *dev, int n, int level);
       
    42 void qdev_get_irq(QEMUDevice *dev, int n, qemu_irq *p);
       
    43 CharDriverState *qdev_get_chardev(QEMUDevice *dev);
       
    44 void qdev_create_interrupts(QEMUDevice *dev, qemu_irq_handler handler, 
       
    45                             void *opaque, int n);
       
    46 int qdev_get_property_int(QEMUDevice *dev, const char *name);
       
    47 const char *qdev_get_property_string(QEMUDevice *dev, const char *name);
       
    48 const char *qdev_get_name(QEMUDevice *dev);
       
    49 void *qdev_get_class_opaque(QEMUDevice *dev);
       
    50 void qdev_set_opaque(QEMUDevice *dev, void *opaque);
       
    51 void qdev_set_region_opaque(QEMUDevice *dev, int n, void *opaque);
       
    52 
       
    53 #ifdef DEVICE_NAME
       
    54 void glue(DEVICE_NAME, _register)(void);
       
    55 #endif