mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-15 22:21:57 -06:00
register: QOMify
QOMify registers as a child of TYPE_DEVICE. This allows registers to define GPIOs. Define an init helper that will do QOM initialisation. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Reviewed-by: KONRAD Frederic <fred.konrad@greensocs.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 2545f71db26bf5586ca0c08a3e3cf1b217450552.1467053537.git.alistair.francis@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
684204593d
commit
49e14ddbce
2 changed files with 37 additions and 0 deletions
|
@ -11,6 +11,7 @@
|
|||
#ifndef REGISTER_H
|
||||
#define REGISTER_H
|
||||
|
||||
#include "hw/qdev-core.h"
|
||||
#include "exec/memory.h"
|
||||
|
||||
typedef struct RegisterInfo RegisterInfo;
|
||||
|
@ -72,6 +73,9 @@ struct RegisterAccessInfo {
|
|||
*/
|
||||
|
||||
struct RegisterInfo {
|
||||
/* <private> */
|
||||
DeviceState parent_obj;
|
||||
|
||||
/* <public> */
|
||||
void *data;
|
||||
int data_size;
|
||||
|
@ -81,6 +85,9 @@ struct RegisterInfo {
|
|||
void *opaque;
|
||||
};
|
||||
|
||||
#define TYPE_REGISTER "qemu,register"
|
||||
#define REGISTER(obj) OBJECT_CHECK(RegisterInfo, (obj), TYPE_REGISTER)
|
||||
|
||||
/**
|
||||
* This structure is used to group all of the individual registers which are
|
||||
* modeled using the RegisterInfo structure.
|
||||
|
@ -131,6 +138,13 @@ uint64_t register_read(RegisterInfo *reg, uint64_t re, const char* prefix,
|
|||
|
||||
void register_reset(RegisterInfo *reg);
|
||||
|
||||
/**
|
||||
* Initialize a register.
|
||||
* @reg: Register to initialize
|
||||
*/
|
||||
|
||||
void register_init(RegisterInfo *reg);
|
||||
|
||||
/**
|
||||
* Memory API MMIO write handler that will write to a Register API register.
|
||||
* @opaque: RegisterInfo to write to
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue