diff options
author | Rui Paulo <rpaulo@FreeBSD.org> | 2013-07-02 06:59:37 +0000 |
---|---|---|
committer | Rui Paulo <rpaulo@FreeBSD.org> | 2013-07-02 06:59:37 +0000 |
commit | 689b22572175648198a75643a1b685cbf3e2282c (patch) | |
tree | 96ab0b8e23fa200c055cc4e7d0b80822d9720e76 /sys/powerpc | |
parent | a5dcb0640f33053e0fe086933a564280d45bd958 (diff) | |
download | src-689b22572175648198a75643a1b685cbf3e2282c.tar.gz src-689b22572175648198a75643a1b685cbf3e2282c.zip |
Add register definitions for the Wii IPC system.
Notes
Notes:
svn path=/head/; revision=252499
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/wii/wii_ipcreg.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/sys/powerpc/wii/wii_ipcreg.h b/sys/powerpc/wii/wii_ipcreg.h index 197a4e08315f..4d0ff1a4e2ac 100644 --- a/sys/powerpc/wii/wii_ipcreg.h +++ b/sys/powerpc/wii/wii_ipcreg.h @@ -34,4 +34,69 @@ #define WIIIPC_IOH_ADDR 0x133e0000 #define WIIIPC_IOH_LEN 0xc20000 +#define WIIIPC_TXBUF 0x00 +#define WIIIPC_CSR 0x04 +#define WIIIPC_CSR_TXSTART 0x01 +#define WIIIPC_CSR_TBEI 0x02 +#define WIIIPC_CSR_RBFI 0x04 +#define WIIIPC_CSR_RXREADY 0x08 +#define WIIIPC_CSR_RBFIMASK 0x10 +#define WIIIPC_CSR_TBEIMASK 0x20 +#define WIIIPC_RXBUF 0x08 +#define WIIIPC_ISR 0x30 +#define WIIIPC_ISR_MAGIC 0x40000000 + +enum wiiipc_cmd { + WIIIPC_CMD_OPEN = 1, + WIIIPC_CMD_CLOSE = 2, + WIIIPC_CMD_READ = 3, + WIIIPC_CMD_WRITE = 4, + WIIIPC_CMD_SEEK = 5, + WIIIPC_CMD_IOCTL = 6, + WIIIPC_CMD_IOCTLV = 7, + WIIIPC_CMD_ASYNCRESP = 8 +}; + +struct wiiipc_ipc_msg { + uint32_t ipc_cmd; + int32_t ipc_result; + int32_t ipc_fd; /* WIIIPC_CMD_ASYNCRESP - the original cmd */ + union { + struct { + intptr_t pathname; + uint32_t mode; + } _ipc_open; + struct { + intptr_t data; + uint32_t len; + } _ipc_read, _ipc_write; + struct { + int32_t offset; + int32_t whence; + } _ipc_seek; + struct { + uint32_t request; + intptr_t ibuf; + uint32_t ilen; + intptr_t obuf; + uint32_t olen; + } _ipc_ioctl; + struct { + uint32_t request; + uint32_t argin; + uint32_t argout; + intptr_t iovec; + } _ipc_ioctlv; + uint32_t _ipc_argv[5]; + } args; +} __attribute__((packed)); + +CTASSERT(sizeof(struct wiiipc_ipc_msg) == 32); + +#define ipc_open args._ipc_open +#define ipc_read args._ipc_read +#define ipc_write args._ipc_write +#define ipc_ioctl args._ipc_ioctl +#define ipc_ioctlv args._ipc_ioctlv + #endif /* _POWERPC_WII_WII_IPCREG_H */ |