funct(3rtapi)
πΈ hey bestie, welcome to funct(3rtapi) πΈ
okay so this page lives in the RTAPI manual, and it's literally just the group chat where userspace and kernel space finally get to talk. it's funct(3rtapi), it's iconic, let's go π
β¨ NAME β¨
rtapi_io.h β RTAPI wrappers for linux kernel functionality π«Ά
β¨ SYNTAX β¨
#include <rtapi_io.h>
unsigned char rtapi_inb(unsigned short int port);
unsigned short rtapi_inw(unsigned short int port);
unsigned int rtapi_inl(unsigned short int port);
unsigned void rtapi_outb(unsigned char value, unsigned short int port);
unsigned void rtapi_outw(unsigned short value, unsigned short int port);
unsigned void rtapi_inl(unsigned int value, unsigned short int port);
int rtapi_ioperm(unsigned long from, unsigned long num, int turn_on);
unsigned void rtapi_outl(unsigned int value, unsigned short int port);
yes bestie, we're copying that exactly, no cap. don't touch it, don't "fix" it, just vibe with it π
β¨ DESCRIPTION β¨
so here's the tea β when you're in kernel space, every single rtapi_xxx or RTAPI_XXX identifier gets mapped straight onto the underlying kernel functionality β if it's available. that's the whole point, it's giving very "we're just a friendly little alias" energy π
and when you're in userspace? or on a kernel where the underlying functionality just... isn't provided by a kernel at all? then generally some other implementation shows up instead β possibly with reduced functionality. she's doing her best, okay π
fr fr, example: the userspace implementation forrtapi_device_register, and the kernel space implementation ofrtapi_ioperm, always succeeds. periodt.
β¨ REALTIME CONSIDERATIONS β¨
you can call these from init/cleanup code and from realtime tasks. slay.
but β οΈ these functions will cause illegal instruction exceptions in non-realtime components, and also in uspace rtapi_app when it is not setuid root. like, she will simply not be having it π
so uh, mind your setuid root situation, bestie. no cap.
β¨ RETURN VALUE β¨
as in Linux. that's it, that's the whole section π
β¨ SEE ALSO β¨
go read those too, iykyk π
β¨ AUTHOR β¨
Jeff Epler π«Ά the actual main character of this page, we stan
and that's a wrap, bestie π this whole thing came to you courtesy of LinuxCNC Documentation, dated 2022-11-29, living on the funct(3rtapi) page forever and ever. go forth and talk to your ports responsibly β¨π¦πΈ
π¦ where this page comes from
- debian trixie: linuxcnc-uspace-dev 1:2.9.4-2+deb13u1 Β· GFDL-1.1-or-later
- ubuntu questing: linuxcnc-uspace-dev 1:2.9.4-2ubuntu2
- ubuntu resolute: linuxcnc-uspace-dev 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- ubuntu stonking: linuxcnc-uspace-dev 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- Copyright (c) 2014 Jeff Epler
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms