Squashed commit of the following:

board/boarctl.c:  Add support for the new BOARDIOC_ROMDISK command.  This allows applications to create ROMFS block drivers without illegal direct calls to romdisk_register.

    include/sys/boardctl.h:  Add basic definitions to support a ROM disk creation boardctl() command.
This commit is contained in:
Gregory Nutt
2019-10-26 13:42:40 -06:00
parent 07edaa088c
commit 118d611a8b
4 changed files with 79 additions and 40 deletions
+31 -12
View File
@@ -99,7 +99,13 @@
* CMD: BOARDIOC_MKRD
* DESCRIPTION: Create a RAM disk
* ARG: Pointer to read-only instance of struct boardioc_mkrd_s.
* CONFIGURATION: CONFIG_DRVR_MKRD
* CONFIGURATION: CONFIG_BOARDCTL_MKRD
* DEPENDENCIES: None
*
* CMD: BOARDIOC_ROMDISK
* DESCRIPTION: Reigster
* ARG: Pointer to read-only instance of struct boardioc_romdisk_s.
* CONFIGURATION: CONFIG_BOARDCTL_ROMDISK
* DEPENDENCIES: None
*
* CMD: BOARDIOC_APP_SYMTAB
@@ -188,15 +194,16 @@
#define BOARDIOC_RESET _BOARDIOC(0x0004)
#define BOARDIOC_UNIQUEID _BOARDIOC(0x0005)
#define BOARDIOC_MKRD _BOARDIOC(0x0006)
#define BOARDIOC_APP_SYMTAB _BOARDIOC(0x0007)
#define BOARDIOC_OS_SYMTAB _BOARDIOC(0x0008)
#define BOARDIOC_BUILTINS _BOARDIOC(0x0009)
#define BOARDIOC_USBDEV_CONTROL _BOARDIOC(0x000a)
#define BOARDIOC_NX_START _BOARDIOC(0x000b)
#define BOARDIOC_VNC_START _BOARDIOC(0x000c)
#define BOARDIOC_NXTERM _BOARDIOC(0x000d)
#define BOARDIOC_NXTERM_IOCTL _BOARDIOC(0x000e)
#define BOARDIOC_TESTSET _BOARDIOC(0x000f)
#define BOARDIOC_ROMDISK _BOARDIOC(0x0007)
#define BOARDIOC_APP_SYMTAB _BOARDIOC(0x0008)
#define BOARDIOC_OS_SYMTAB _BOARDIOC(0x0009)
#define BOARDIOC_BUILTINS _BOARDIOC(0x000a)
#define BOARDIOC_USBDEV_CONTROL _BOARDIOC(0x000b)
#define BOARDIOC_NX_START _BOARDIOC(0x000c)
#define BOARDIOC_VNC_START _BOARDIOC(0x000d)
#define BOARDIOC_NXTERM _BOARDIOC(0x000e)
#define BOARDIOC_NXTERM_IOCTL _BOARDIOC(0x000f)
#define BOARDIOC_TESTSET _BOARDIOC(0x0010)
/* If CONFIG_BOARDCTL_IOCTL=y, then board-specific commands will be support.
* In this case, all commands not recognized by boardctl() will be forwarded
@@ -205,7 +212,7 @@
* User defined board commands may begin with this value:
*/
#define BOARDIOC_USER _BOARDIOC(0x0010)
#define BOARDIOC_USER _BOARDIOC(0x0011)
/****************************************************************************
* Public Type Definitions
@@ -213,7 +220,7 @@
/* Structures used with IOCTL commands */
#ifdef CONFIG_DRVR_MKRD
#ifdef CONFIG_BOARDCTL_MKRD
/* Describes the RAM disk to be created */
struct boardioc_mkrd_s
@@ -225,6 +232,18 @@ struct boardioc_mkrd_s
};
#endif
#ifdef CONFIG_BOARDCTL_ROMDISK
/* Describes the ROM disk image to be registered */
struct boardioc_romdisk_s
{
uint8_t minor; /* Minor device number of the RAM disk. */
uint32_t nsectors; /* The number of sectors in the RAM disk */
uint16_t sectsize; /* The size of one sector in bytes */
FAR const uint8_t *image;
};
#endif
/* In order to full describe a symbol table, a vector containing the address
* of the symbol table and the number of elements in the symbol table is
* required.