|
Muteki
EABI code execution on Besta® RTOS devices.
|
Device IO API. More...
#include "common.h"Go to the source code of this file.
Data Structures | |
| struct | devio_descriptor_t |
| The device IO descriptor. More... | |
Macros | |
| #define | DEVIO_DESC_MAGIC (0x48435842u) |
| Magic for device IO descriptor. | |
| #define | DEVIO_DESC_INVALID ((devio_descriptor_t *) 0xffffffff) |
| Invalid descriptor. | |
Typedefs | |
| typedef void | devio_backend_t |
| Catchall device IO backend type. | |
| typedef char | device_service_t[0x4c] |
Functions | |
| devio_descriptor_t * | CreateFile (const char *pathname, unsigned int access, unsigned int shmode, void *secattr, unsigned int on_noentry, unsigned int flags, void *template_file) |
| Open or create a file/device by its pathname. | |
| bool | ReadFile (devio_descriptor_t *devfd, void *buf, size_t size, size_t *actual_size, void *overlapped) |
| Read/receive data from a device IO descriptor. | |
| bool | WriteFile (devio_descriptor_t *devfd, const void *buf, size_t size, size_t *actual_size, void *overlapped) |
| Write/send data to a device IO descriptor. | |
| bool | DeviceIoControl (devio_descriptor_t *devfd, int request, const void *in, int inlen, void *out, int outlen, int *retlen, void *overlapped) |
| Send an IOCTL request to a device IO descriptor devfd. | |
| bool | CloseHandle (devio_descriptor_t *devfd) |
| Close a device IO descriptor. | |
Device IO API.
| #define DEVIO_DESC_INVALID ((devio_descriptor_t *) 0xffffffff) |
Invalid descriptor.
This is usually returned by CreateFile() when an error occurred.
| #define DEVIO_DESC_MAGIC (0x48435842u) |
Magic for device IO descriptor.
The value is ASCII "BXCH".
| typedef void devio_backend_t |
Catchall device IO backend type.
|
extern |
Close a device IO descriptor.
Analogous to the Windows CloseHandle() API.
| devfd | Descriptor to close. |
| true | The operation was completed successfully. |
| false | The operation failed with error. |
|
extern |
Open or create a file/device by its pathname.
Analogous to the Windows CreateFile() API.
| pathname | DOS 8.3 path to the file to be opened. |
| access | Access flags. |
| shmode | File sharing mode. (?) |
| secattr | Seems to be ignored. |
| on_noentry | Behavior when entry does not exist. (?) |
| flags | Flags and attributes of the file. (?) |
| template_file | Seems to be ignored. |
|
extern |
Send an IOCTL request to a device IO descriptor devfd.
Analogous to the Windows DeviceIoControl() API.
| devfd | Device IO descriptor. |
| request | IOCTL request type. |
| in | The input buffer, or NULL if not applicable. |
| inlen | The size of the input buffer in bytes. |
| out | The output buffer, or NULL if not applicable. |
| outlen | The size of the output buffer in bytes. |
| retlen | The size of returned data (if applicable). |
| overlapped | Probably ignored. |
| true | The operation was completed successfully. |
| false | The operation failed with error. |
|
extern |
Read/receive data from a device IO descriptor.
Analogous to the Windows ReadFile() API.
| devfd | The device IO descriptor. | |
| [out] | buf | Buffer to hold data read from the descriptor. |
| size | Number of bytes to read. | |
| [out] | actual_size | Number of bytes actually read. |
| overlapped | Reserved. |
| true | The operation was completed successfully. |
| false | The operation failed with error. |
|
extern |
Write/send data to a device IO descriptor.
Analogous to the Windows WriteFile() API.
| devfd | The device IO descriptor. | |
| [in] | buf | Buffer to hold data to be written to the descriptor. |
| size | Number of bytes to write. | |
| [out] | actual_size | Number of bytes actually written. |
| overlapped | Reserved. |
| true | The operation was completed successfully. |
| false | The operation failed with error. |