Add IOCTL interface to uORBManager for nuttx protected/kernel build split

When building uORB for NuttX flat build, or for some other target, everything
works as before.

When building uORB for NuttX protected or kernel build, this does the following:
- The kernel side uORB library reigsters a boardctl handler for calls from userspace
  and services the boardctl_ioctls by calling the actual uORB functions
- For user mode binaries, the uORBManager acts as a proxy, making boardctl_ioctl calls to the
  kernel side
- The uORBDeviceNodes are always allocated in user heap for protected build, so that they
  are accessible from both kernel and user side. This is only for optimization, a few
  functions such as "is_advertised" get really heavy when called frequently via ioctl

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
Jukka Laitinen
2021-09-23 13:57:31 +03:00
parent f54e56d6a8
commit 92877e1f35
5 changed files with 590 additions and 3 deletions
+13
View File
@@ -233,6 +233,19 @@ public:
// remove item from list of work items
void unregister_callback(SubscriptionCallback *callback_sub);
// Allocate this always from user heap, also in NuttX
// protected build. This allows direct access to some member
// variables from the whole system; sort of a shared memmory
// TODO: For nuttx kernel build, in shared memory
void *operator new (size_t nbytes)
{
return malloc(nbytes);
}
void operator delete (void *p)
{
free(p);
}
protected:
px4_pollevent_t poll_state(cdev::file_t *filp) override;