                    
                                   ``A good magician never reveals
                                     his secret; the unbelievable trick
                                     becomes simple and obvious once it is
                                     explained. So too with UNIX.''

  NGPT - Next Generation POSIX Threading

  PORTING
  =======

  SUCCESSFULLY TESTED PLATFORMS

  The NGPT package was successfully tested on the following platforms
  (and should automatically adjust to other platforms, of course):

  __PLATFORM_ID_______________________ __MACHINE_CONTEXT__ __STACK__ __VERSION__
  i686-suse-linux-gnu2.4glibc2.2      | sjlj/ssjlj/sas    | down    | 0.9.3 
  i586-suse-linux-gnu2.4glibc2.2      | sjlj/ssjlj/sas    | down    | 0.9.3 
  i686-suse-linux-gnu2.2glibc2.1      | sjlj/ssjlj/sas    | down    | 0.9.3
  i586-suse-linux-gnu2.2glibc2.1      | sjlj/ssjlj/sas    | down    | 0.9.3
  i686-redhat-linux-gnu2.4glibc2.2    | sjlj/ssjlj/sas    | down    | 0.9.3
  i586-redhat-linux-gnu2.4glibc2.2    | sjlj/ssjlj/sas    | down    | 0.9.3


  HINTS FOR PORTING TO NEW PLATFORMS

  In case you're not able to use NGPT on a new and esoteric platform,
  here are a few hints.

  NGPT has only two parts which perhaps has to be ported to new platforms: the
  machine context initialization, i.e. the function pth_mctx_set() in
  pth_mctx.c and the code used to create kernel threads in pth_native.c.  The 
  first exercise is to write a pth_mctx_set() function which initializes a `jmp_buf' 
  (see setjmp(3)) with a given function and stack, so when the next longjmp(3) 
  is done on this `jmp_buf', the function starts executing on the given stack. The
  second involves writing an implementation of pth_new_native() in pth_native.c
  that will create the appropriate kernel thread, i.e. clone() on Linux or clone2()
  on Linux/IA64.

  By default, NGPT uses a very tricky sigstack/sigaltstack() based approach for
  establishing this `jmp_buf' which is mostly portable to all major Unix
  platforms which support the involved POSIX functions (see rse-pmt.ps for a
  detailed description of the trick). So the chance is very high that this
  approach also works for forthcoming platforms and no real porting is
  required.

  When this approach should not work (for instance brain-dead achient
  GNU/Linux versions have a dummy sigstack/sigaltstack(), so we've no chance
  this way), then you've to provide an alternative implementation. This
  usually is done be fiddling around with the ingredients of a `jmp_buf'
  structure. For this look inside your /usr/include/setjmp.h (plus files it
  includes) and there especially for things like _pc or JB_PC (the program
  counter) and _sp or JB_SP (the stack pointer). Then write an alternative
  pth_mctx_set() function in pth_mctx.c.

  Currently, as mentioned, NGPT requires such an alternative only under
  GNU/Linux where sigstack/sigaltstack() are dummy functions. Look at the
  GNU/Linux pth_mctx_set() variant in pth_mctx.c to get an impression what
  type of `jmp_buf' fiddling you perhaps have to do for esoteric platforms.
  Don't be confused by the fact that such specialized pth_mctx_set() functions
  are just a few lines long while the standard function is very large. That's
  all just needed for maximum portability.  The goal nevertheless only is to
  initialize a `jmp_buf' with PC and SP. That's all...

  Additionally see the INSTALL document for the --enable-mctx-XXX options.
  These can be used to easily try out mctx combinations on a platform, too.

