Revision 5fafdf24 vl.h

b/vl.h
1 1
/*
2 2
 * QEMU System Emulator header
3
 * 
3
 *
4 4
 * Copyright (c) 2003 Fabrice Bellard
5
 * 
5
 *
6 6
 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 7
 * of this software and associated documentation files (the "Software"), to deal
8 8
 * in the Software without restriction, including without limitation the rights
......
248 248
typedef int IOCanRWHandler(void *opaque);
249 249
typedef void IOHandler(void *opaque);
250 250

  
251
int qemu_set_fd_handler2(int fd, 
252
                         IOCanRWHandler *fd_read_poll, 
253
                         IOHandler *fd_read, 
254
                         IOHandler *fd_write, 
251
int qemu_set_fd_handler2(int fd,
252
                         IOCanRWHandler *fd_read_poll,
253
                         IOHandler *fd_read,
254
                         IOHandler *fd_write,
255 255
                         void *opaque);
256 256
int qemu_set_fd_handler(int fd,
257
                        IOHandler *fd_read, 
257
                        IOHandler *fd_read,
258 258
                        IOHandler *fd_write,
259 259
                        void *opaque);
260 260

  
......
324 324
void qemu_chr_printf(CharDriverState *s, const char *fmt, ...);
325 325
int qemu_chr_write(CharDriverState *s, const uint8_t *buf, int len);
326 326
void qemu_chr_send_event(CharDriverState *s, int event);
327
void qemu_chr_add_handlers(CharDriverState *s, 
328
                           IOCanRWHandler *fd_can_read, 
327
void qemu_chr_add_handlers(CharDriverState *s,
328
                           IOCanRWHandler *fd_can_read,
329 329
                           IOReadHandler *fd_read,
330 330
                           IOEventHandler *fd_event,
331 331
                           void *opaque);
......
528 528
typedef void SaveStateHandler(QEMUFile *f, void *opaque);
529 529
typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);
530 530

  
531
int register_savevm(const char *idstr, 
532
                    int instance_id, 
531
int register_savevm(const char *idstr,
532
                    int instance_id,
533 533
                    int version_id,
534 534
                    SaveStateHandler *save_state,
535 535
                    LoadStateHandler *load_state,
......
573 573

  
574 574
typedef struct BlockDriverInfo {
575 575
    /* in bytes, 0 if irrelevant */
576
    int cluster_size; 
576
    int cluster_size;
577 577
    /* offset at which the VM state can be saved (0 if not possible) */
578
    int64_t vm_state_offset; 
578
    int64_t vm_state_offset;
579 579
} BlockDriverInfo;
580 580

  
581 581
typedef struct QEMUSnapshotInfo {
......
601 601

  
602 602
void bdrv_init(void);
603 603
BlockDriver *bdrv_find_format(const char *format_name);
604
int bdrv_create(BlockDriver *drv, 
604
int bdrv_create(BlockDriver *drv,
605 605
                const char *filename, int64_t size_in_sectors,
606 606
                const char *backing_file, int flags);
607 607
BlockDriverState *bdrv_new(const char *device_name);
......
611 611
int bdrv_open2(BlockDriverState *bs, const char *filename, int flags,
612 612
               BlockDriver *drv);
613 613
void bdrv_close(BlockDriverState *bs);
614
int bdrv_read(BlockDriverState *bs, int64_t sector_num, 
614
int bdrv_read(BlockDriverState *bs, int64_t sector_num,
615 615
              uint8_t *buf, int nb_sectors);
616
int bdrv_write(BlockDriverState *bs, int64_t sector_num, 
616
int bdrv_write(BlockDriverState *bs, int64_t sector_num,
617 617
               const uint8_t *buf, int nb_sectors);
618
int bdrv_pread(BlockDriverState *bs, int64_t offset, 
618
int bdrv_pread(BlockDriverState *bs, int64_t offset,
619 619
               void *buf, int count);
620
int bdrv_pwrite(BlockDriverState *bs, int64_t offset, 
620
int bdrv_pwrite(BlockDriverState *bs, int64_t offset,
621 621
                const void *buf, int count);
622 622
int bdrv_truncate(BlockDriverState *bs, int64_t offset);
623 623
int64_t bdrv_getlength(BlockDriverState *bs);
......
657 657
#define BIOS_ATA_TRANSLATION_LARGE  3
658 658
#define BIOS_ATA_TRANSLATION_RECHS  4
659 659

  
660
void bdrv_set_geometry_hint(BlockDriverState *bs, 
660
void bdrv_set_geometry_hint(BlockDriverState *bs,
661 661
                            int cyls, int heads, int secs);
662 662
void bdrv_set_type_hint(BlockDriverState *bs, int type);
663 663
void bdrv_set_translation_hint(BlockDriverState *bs, int translation);
664
void bdrv_get_geometry_hint(BlockDriverState *bs, 
664
void bdrv_get_geometry_hint(BlockDriverState *bs,
665 665
                            int *pcyls, int *pheads, int *psecs);
666 666
int bdrv_get_type_hint(BlockDriverState *bs);
667 667
int bdrv_get_translation_hint(BlockDriverState *bs);
......
672 672
int bdrv_is_locked(BlockDriverState *bs);
673 673
void bdrv_set_locked(BlockDriverState *bs, int locked);
674 674
void bdrv_eject(BlockDriverState *bs, int eject_flag);
675
void bdrv_set_change_cb(BlockDriverState *bs, 
675
void bdrv_set_change_cb(BlockDriverState *bs,
676 676
                        void (*change_cb)(void *opaque), void *opaque);
677 677
void bdrv_get_format(BlockDriverState *bs, char *buf, int buf_size);
678 678
void bdrv_info(void);
......
680 680
void bdrv_iterate(void (*it)(void *opaque, const char *name), void *opaque);
681 681
int bdrv_is_encrypted(BlockDriverState *bs);
682 682
int bdrv_set_key(BlockDriverState *bs, const char *key);
683
void bdrv_iterate_format(void (*it)(void *opaque, const char *name), 
683
void bdrv_iterate_format(void (*it)(void *opaque, const char *name),
684 684
                         void *opaque);
685 685
const char *bdrv_get_device_name(BlockDriverState *bs);
686
int bdrv_write_compressed(BlockDriverState *bs, int64_t sector_num, 
686
int bdrv_write_compressed(BlockDriverState *bs, int64_t sector_num,
687 687
                          const uint8_t *buf, int nb_sectors);
688 688
int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi);
689 689

  
690
void bdrv_get_backing_filename(BlockDriverState *bs, 
690
void bdrv_get_backing_filename(BlockDriverState *bs,
691 691
                               char *filename, int filename_size);
692
int bdrv_snapshot_create(BlockDriverState *bs, 
692
int bdrv_snapshot_create(BlockDriverState *bs,
693 693
                         QEMUSnapshotInfo *sn_info);
694
int bdrv_snapshot_goto(BlockDriverState *bs, 
694
int bdrv_snapshot_goto(BlockDriverState *bs,
695 695
                       const char *snapshot_id);
696 696
int bdrv_snapshot_delete(BlockDriverState *bs, const char *snapshot_id);
697
int bdrv_snapshot_list(BlockDriverState *bs, 
697
int bdrv_snapshot_list(BlockDriverState *bs,
698 698
                       QEMUSnapshotInfo **psn_info);
699 699
char *bdrv_snapshot_dump(char *buf, int buf_size, QEMUSnapshotInfo *sn);
700 700

  
......
706 706

  
707 707
#ifndef QEMU_TOOL
708 708

  
709
typedef void QEMUMachineInitFunc(int ram_size, int vga_ram_size, 
709
typedef void QEMUMachineInitFunc(int ram_size, int vga_ram_size,
710 710
                                 int boot_device,
711 711
             DisplayState *ds, const char **fd_filename, int snapshot,
712 712
             const char *kernel_filename, const char *kernel_cmdline,
......
740 740
typedef void (IOPortWriteFunc)(void *opaque, uint32_t address, uint32_t data);
741 741
typedef uint32_t (IOPortReadFunc)(void *opaque, uint32_t address);
742 742

  
743
int register_ioport_read(int start, int length, int size, 
743
int register_ioport_read(int start, int length, int size,
744 744
                         IOPortReadFunc *func, void *opaque);
745
int register_ioport_write(int start, int length, int size, 
745
int register_ioport_write(int start, int length, int size,
746 746
                          IOPortWriteFunc *func, void *opaque);
747 747
void isa_unassign_ioport(int start, int length);
748 748

  
......
755 755
typedef struct PCIBus PCIBus;
756 756
typedef struct PCIDevice PCIDevice;
757 757

  
758
typedef void PCIConfigWriteFunc(PCIDevice *pci_dev, 
758
typedef void PCIConfigWriteFunc(PCIDevice *pci_dev,
759 759
                                uint32_t address, uint32_t data, int len);
760
typedef uint32_t PCIConfigReadFunc(PCIDevice *pci_dev, 
760
typedef uint32_t PCIConfigReadFunc(PCIDevice *pci_dev,
761 761
                                   uint32_t address, int len);
762
typedef void PCIMapIORegionFunc(PCIDevice *pci_dev, int region_num, 
762
typedef void PCIMapIORegionFunc(PCIDevice *pci_dev, int region_num,
763 763
                                uint32_t addr, uint32_t size, int type);
764 764

  
765 765
#define PCI_ADDRESS_SPACE_MEM		0x00
......
798 798
    int devfn;
799 799
    char name[64];
800 800
    PCIIORegion io_regions[PCI_NUM_REGIONS];
801
    
801
   
802 802
    /* do not access the following fields */
803 803
    PCIConfigReadFunc *config_read;
804 804
    PCIConfigWriteFunc *config_write;
......
814 814

  
815 815
PCIDevice *pci_register_device(PCIBus *bus, const char *name,
816 816
                               int instance_size, int devfn,
817
                               PCIConfigReadFunc *config_read, 
817
                               PCIConfigReadFunc *config_read,
818 818
                               PCIConfigWriteFunc *config_write);
819 819

  
820
void pci_register_io_region(PCIDevice *pci_dev, int region_num, 
821
                            uint32_t size, int type, 
820
void pci_register_io_region(PCIDevice *pci_dev, int region_num,
821
                            uint32_t size, int type,
822 822
                            PCIMapIORegionFunc *map_func);
823 823

  
824
uint32_t pci_default_read_config(PCIDevice *d, 
824
uint32_t pci_default_read_config(PCIDevice *d,
825 825
                                 uint32_t address, int len);
826
void pci_default_write_config(PCIDevice *d, 
826
void pci_default_write_config(PCIDevice *d,
827 827
                              uint32_t address, uint32_t val, int len);
828 828
void pci_device_save(PCIDevice *s, QEMUFile *f);
829 829
int pci_device_load(PCIDevice *s, QEMUFile *f);
......
940 940
    s->dpy_resize(s, w, h);
941 941
}
942 942

  
943
int isa_vga_init(DisplayState *ds, uint8_t *vga_ram_base, 
943
int isa_vga_init(DisplayState *ds, uint8_t *vga_ram_base,
944 944
                 unsigned long vga_ram_offset, int vga_ram_size);
945
int pci_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base, 
945
int pci_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,
946 946
                 unsigned long vga_ram_offset, int vga_ram_size,
947 947
                 unsigned long vga_bios_offset, int vga_bios_size);
948 948
int isa_vga_mm_init(DisplayState *ds, uint8_t *vga_ram_base,
......
951 951
                    int it_shift);
952 952

  
953 953
/* cirrus_vga.c */
954
void pci_cirrus_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base, 
954
void pci_cirrus_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,
955 955
                         unsigned long vga_ram_offset, int vga_ram_size);
956
void isa_cirrus_vga_init(DisplayState *ds, uint8_t *vga_ram_base, 
956
void isa_cirrus_vga_init(DisplayState *ds, uint8_t *vga_ram_base,
957 957
                         unsigned long vga_ram_offset, int vga_ram_size);
958 958

  
959 959
/* vmware_vga.c */
......
1032 1032

  
1033 1033
typedef struct fdctrl_t fdctrl_t;
1034 1034

  
1035
fdctrl_t *fdctrl_init (qemu_irq irq, int dma_chann, int mem_mapped, 
1035
fdctrl_t *fdctrl_init (qemu_irq irq, int dma_chann, int mem_mapped,
1036 1036
                       target_phys_addr_t io_base,
1037 1037
                       BlockDriverState **fds);
1038 1038
int fdctrl_get_drive_type(fdctrl_t *fdctrl, int drive_num);
......
1286 1286
/* sparc32_dma.c */
1287 1287
void *sparc32_dma_init(target_phys_addr_t daddr, qemu_irq parent_irq,
1288 1288
                       void *iommu, qemu_irq **dev_irq, qemu_irq **reset);
1289
void ledma_memory_read(void *opaque, target_phys_addr_t addr, 
1289
void ledma_memory_read(void *opaque, target_phys_addr_t addr,
1290 1290
                       uint8_t *buf, int len, int do_bswap);
1291
void ledma_memory_write(void *opaque, target_phys_addr_t addr, 
1291
void ledma_memory_write(void *opaque, target_phys_addr_t addr,
1292 1292
                        uint8_t *buf, int len, int do_bswap);
1293 1293
void espdma_memory_read(void *opaque, uint8_t *buf, int len);
1294 1294
void espdma_memory_write(void *opaque, uint8_t *buf, int len);
......
1354 1354
                const uint8_t *buf, int len);
1355 1355
int adb_poll(ADBBusState *s, uint8_t *buf_out);
1356 1356

  
1357
ADBDevice *adb_register_device(ADBBusState *s, int devaddr, 
1358
                               ADBDeviceRequest *devreq, 
1359
                               ADBDeviceReset *devreset, 
1357
ADBDevice *adb_register_device(ADBBusState *s, int devaddr,
1358
                               ADBDeviceRequest *devreq,
1359
                               ADBDeviceReset *devreset,
1360 1360
                               void *opaque);
1361 1361
void adb_kbd_init(ADBBusState *bus);
1362 1362
void adb_mouse_init(ADBBusState *bus);
......
1508 1508
pflash_t *pflash_register (target_phys_addr_t base, ram_addr_t off,
1509 1509
                           BlockDriverState *bs,
1510 1510
                           uint32_t sector_len, int nb_blocs, int width,
1511
                           uint16_t id0, uint16_t id1, 
1511
                           uint16_t id0, uint16_t id1,
1512 1512
                           uint16_t id2, uint16_t id3);
1513 1513

  
1514 1514
/* nand.c */
1515 1515
struct nand_flash_s;
1516 1516
struct nand_flash_s *nand_init(int manf_id, int chip_id);
1517 1517
void nand_done(struct nand_flash_s *s);
1518
void nand_setpins(struct nand_flash_s *s, 
1518
void nand_setpins(struct nand_flash_s *s,
1519 1519
                int cle, int ale, int ce, int wp, int gnd);
1520 1520
void nand_getpins(struct nand_flash_s *s, int *rb);
1521 1521
void nand_setio(struct nand_flash_s *s, uint8_t value);

Also available in: Unified diff