mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-11 07:01:37 +08:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user