diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 19:30:32 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 19:30:32 -0800 |
commit | 8b23a6c7e1aee255004dd19098d4c2462b61b849 (patch) | |
tree | 7a4d682ba51f0ff0364c5ca2509f515bdaf96de9 /hw/goldfish_device.h | |
parent | f721e3ac031f892af46f255a47d7f54a91317b30 (diff) | |
download | external_qemu-8b23a6c7e1aee255004dd19098d4c2462b61b849.zip external_qemu-8b23a6c7e1aee255004dd19098d4c2462b61b849.tar.gz external_qemu-8b23a6c7e1aee255004dd19098d4c2462b61b849.tar.bz2 |
auto import from //depot/cupcake/@135843
Diffstat (limited to 'hw/goldfish_device.h')
-rw-r--r-- | hw/goldfish_device.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/hw/goldfish_device.h b/hw/goldfish_device.h new file mode 100644 index 0000000..abe102e --- /dev/null +++ b/hw/goldfish_device.h @@ -0,0 +1,58 @@ +/* Copyright (C) 2007-2008 The Android Open Source Project +** +** This software is licensed under the terms of the GNU General Public +** License version 2, as published by the Free Software Foundation, and +** may be copied, distributed, and modified under those terms. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +*/ +#ifndef GOLDFISH_DEVICE_H +#define GOLDFISH_DEVICE_H + +struct goldfish_device { + struct goldfish_device *next; + struct goldfish_device *prev; + uint32_t reported_state; + void *cookie; + const char *name; + uint32_t id; + uint32_t base; // filled in by goldfish_device_add if 0 + uint32_t size; + uint32_t irq; // filled in by goldfish_device_add if 0 + uint32_t irq_count; +}; + + +void goldfish_device_set_irq(struct goldfish_device *dev, int irq, int level); +int goldfish_device_add(struct goldfish_device *dev, + CPUReadMemoryFunc **mem_read, + CPUWriteMemoryFunc **mem_write, + void *opaque); + +int goldfish_add_device_no_io(struct goldfish_device *dev); + +void goldfish_device_init(qemu_irq *pic, uint32_t base, uint32_t size, uint32_t irq, uint32_t irq_count); +int goldfish_device_bus_init(uint32_t base, uint32_t irq); + +// device init functions: +qemu_irq *goldfish_interrupt_init(uint32_t base, qemu_irq parent_irq, qemu_irq parent_fiq); +void goldfish_timer_and_rtc_init(uint32_t timerbase, int timerirq); +int goldfish_tty_add(CharDriverState *cs, int id, uint32_t base, int irq); +void goldfish_fb_init(DisplayState *ds, int id); +void goldfish_audio_init(uint32_t base, int id, const char* input_source); +void goldfish_battery_init(); +void goldfish_battery_set_prop(int ac, int property, int value); +void goldfish_battery_display(void (* callback)(void *data, const char* string), void *data); +void goldfish_mmc_init(uint32_t base, int id, BlockDriverState* bs); +void *goldfish_switch_add(char *name, uint32_t (*writefn)(void *opaque, uint32_t state), void *writeopaque, int id); +void goldfish_switch_set_state(void *opaque, uint32_t state); + +// these do not add a device +void trace_dev_init(uint32_t base); +void events_dev_init(uint32_t base, qemu_irq irq); +void nand_dev_init(uint32_t base); + +#endif |