Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/man/man3/rtapi_io.3rtapi
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ unsigned void rtapi_outb(unsigned char value, unsigned short int port);
.HP
unsigned void rtapi_outw(unsigned short value, unsigned short int port);
.HP
unsigned void rtapi_inl(unsigned int value, unsigned short int port);
.HP
int rtapi_ioperm(unsigned long from, unsigned long num, int turn_on);
.HP
unsigned void rtapi_outl(unsigned int value, unsigned short int port);

.SH DESCRIPTION
Expand All @@ -47,7 +51,8 @@ underlying kernel functionality, if available.
In userspace, or in kernels where the underlying functionality is not provided
by a kernel, generally another implementation--possibly with reduced
functionality--is provided. (For example, the userspace implementation for
rtapi_device_register always succeeds)
rtapi_device_register and the kernel space implementation of rtapi_ioperm always
succeeds)
.SH REALTIME CONSIDERATIONS
Call from init/cleanup code and from realtime tasks. These functions will
cause illegal instruction exceptions in userspace components, as well as in
Expand Down
3 changes: 2 additions & 1 deletion src/hal/drivers/hal_speaker.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
#include "config.h" /* environment flags */
#include "rtapi.h" /* RTAPI realtime OS API */
#include "rtapi_app.h" /* RTAPI realtime module decls */
#include "rtapi_io.h"
#include "hal.h" /* HAL public API decls */

/* If FASTIO is defined, uses outb() and inb() from <asm.io>,
Expand Down Expand Up @@ -161,7 +162,7 @@ int rtapi_app_main(void)

#if !defined(RTAPI_RTAI)
/* STEP 1.1: get access to port, only needed in uspace builds */
if (ioperm(SPEAKER_PORT, 1, 1) < 0) {
if (rtapi_ioperm(SPEAKER_PORT, 1, 1) < 0) {
rtapi_print_msg(RTAPI_MSG_ERR,
"SPEAKER: ERROR: ioperm() failed\n");
hal_exit(comp_id);
Expand Down
2 changes: 2 additions & 0 deletions src/rtapi/rtapi_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@
#define rtapi_outb outb
#define rtapi_outw outw
#define rtapi_outl outl
#define rtapi_ioperm ioperm
#else
#define rtapi_inb(x) (0)
#define rtapi_inw(x) (0)
#define rtapi_inl(x) (0)
#define rtapi_outb(x,y) ((void)0)
#define rtapi_outw(x,y) ((void)0)
#define rtapi_outl(x,y) ((void)0)
#define rtapi_ioperm(x,y,z) ((void)0)
#endif

#endif