rtapi flavor loading example

build and run rtapiload

Conflicts:
	src/rtapi/Submakefile
import kdetect
hal_lib: introduce constructors, hal_rtapi_attach()/hal_rtapi_detach()

add constructors which give fine-grain control over what happens during
startup or shutdown, both for ULAPI and RTAPI.

ULAPI: Separate attaching/detaching the RTAPI shm segment from hal_init/hal_exit
and move to constructor/destructor, which now call hal_rtapi_attach() and
hal_rtapi_detach.

This assures the RTAPI segment is always available and hence can be used
for session-global variables like the RTAPI message level.

This was not possible before since the RTAPI segment would be attached
only during first hal_init(), which is too late for use for instance by
msglevel.
hal_lib: remove refcounting scheme
rtapi_app: carry over from rtapi-startup-sequencing

no more default loading of hal_lib
do not exit anymore if no module loaded yet - this will happen
explicitly through scripts/realtime; but fork and go into background

move RT hardening code to child process
rtapi.so: add rtapi_app_main/rtapi_app_exit stubs

so it can be explicitly loaded by 'rtapi_app load rtapi'
catch up commit before me crashing
rtapi:  herd all rtapi_*() calls through rtapi_switch for universal binary

- rtapi_*() function definitions renamed with underscore prepended
  - e.g. _rtapi_outb() in rtapi_io.c
  - Also change EXPORT_SYMBOL() to match new name
- in rtapi.h:
  - function pointer typedef for each _rtapi_*() function
  - add underscore to function declaration
  - create macro function calling real function through its rtapi_switch
    pointer
  - declare the rtapi_switch_t type and the rtapi_switch struct
- init rtapi_switch in rtapi_common.c
rtapi: dont EXPORT_SYMBOL anything except rtapi_switch
rtapi_shmem: fix typo
rtapi: remove all exported symbols except rtapi_switch
stashf.c: include rtapi.h to get proper symbol visibility
rtapi: build ulapi.so
hal: remove ULAPI objects from hal_lib link

here's the issue: we cant refer to the rtapi_switch through an external
struct reference; it needs to be a pointer, otherwise we cant dlsym that
in ULAPI hallib.
rtapi: make rtapi functions go through a pointer, not a struct ref

otherwise we cant dlsym this properly in ULAPI
hal_lib/ULAPI: dynload ulapi.os - first round

not configurable pathname yet, but _working_!
rtapi: export rtapi_dir

the kernel thread styles need this
hal_lib.c: touchups
hal_lib.c: TODO note
docs/man/man3/rtapi_init.3rtapi: back out API change