funct(3rtapi)

🌸 funct(3rtapi) 🌸

okay bestie, welcome to the 3rtapi girlies club πŸ’… this is funct from section 3 of the RTAPI manuals, and it's all about rtapi_pci.h β€” RTAPI wrappers for linux kernel functionality. yes it's kernel-adjacent, yes it's a little feral, no we are not scared. πŸ¦‹


✨ NAME ✨

rtapi_pci.h β€” RTAPI wrappers for linux kernel functionality 🫢


✨ SYNTAX ✨

bestie here's the whole vibe, verbatim, no edits, she's serving exactly what she serves πŸ‘‘

#include <rtapi_pci.h>

struct rtapi_pci_device_id { ... };

struct rtapi_pci_resource { ... };

struct rtapi_pci_dev { ... };

struct rtapi_pci_driver { ... };

const char *rtapi_pci_name(const struct rtapi_pci_dev *pdev);

int rtapi_pci_enable_device(struct rtapi_pci_dev *dev);

void rtapi__iomem *rtapi_pci_ioremap_bar(struct rtapi_pci_dev *pdev, int
       bar);

int rtapi_pci_register_driver(struct rtapi_pci_driver *driver);

void rtapi_pci_unregister_driver(struct rtapi_pci_driver *driver);

int rtapi_pci_enable_device(struct rtapi_pci_dev *dev);

int rtapi_pci_disable_device(struct rtapi_pci_dev *dev);

#define rtapi_pci_resource_start(dev, bar) ...

#define rtapi_pci_resource_end(dev, bar) ...

#define rtapi_pci_resource_flags(dev, bar) ...

#define rtapi_pci_resource_len(dev,bar) ....

void rtapi_pci_set_drvdata(struct rtapi_pci_dev *pdev, void *data)

void rtapi_pci_set_drvdata(struct rtapi_pci_dev *pdev, void *data)

void rtapi_iounmap(volatile void *addr);

struct rtapi_pci;
not me spotting rtapi_pci_enable_device twice and rtapi_pci_set_drvdata twice in there πŸ’€ bestie that's not a typo on my end, that's literally how she's written. we do not "fix" the original, we respect her exactly as she is. periodt.

✨ DESCRIPTION ✨

okay so here's the whole concept, and it's actually iconic πŸŽ€

  • In kernel space, every rtapi_xxx or RTAPI_XXX identifier gets mapped to the underlying kernel functionality β€” if available. iykyk. πŸ’–
  • In userspace, or in kernels where the underlying functionality just isn't provided by a kernel, generally another implementation is provided instead β€” possibly with reduced functionality. like, she's still showing up, she's just maybe wearing a slightly different outfit. lowkey valid.
    • for example: the userspace implementation for rtapi_pci_register always succeeds. always. no notes. she ate and left no crumbs ✨

✨ REALTIME CONSIDERATIONS ✨

typically, these functions may be called from realtime init/cleanup code. so like, if you're in your realtime era, you're good to go bestie 🫢


✨ RETURN VALUE ✨

as in Linux. πŸ’… (that's it, that's the whole sentence, and honestly? she's right.)


✨ SEE ALSO ✨

LinuxCNC Documentation πŸ“–βœ¨


mwah πŸ’œ that's the whole page, bestie. this one is from the LinuxCNC Documentation, dated 2014-06-28, filed under funct(3rtapi) β€” go forth, wrap those kernel functions, and slay responsibly. no cap. πŸŽ€πŸ¦‹πŸ’–