next up previous contents
Next: 5.1.4.1 Multiprocessing on Intels Up: 5.1 Shuttles Previous: 5.1.3.2 Freezing shuttle servers

5.1.4 Shuttles C++ source files

Shuttle server code is found in shtl/ShtlSrv.h and shtl/ShtlSrv.C.

<ShtlSrv.h*>=
<Read the literate code instead warning. >
#ifndef __OFF_SHTL_SRV_H
#define __OFF_SHTL_SRV_H 1

<Off shuttle server dependencies. >

#ifdef __KERNEL__
<Off shuttle server. >

<Off shuttle server exported variables. >

#endif // __KERNEL__

#ifdef __KERNEL__
<off_ShtlSrv::make_available implementation. >
<off_ShtlSrv::is_local implementation. >
<off_ShtlSrv::valid implementation. >
<off_ShtlSrv::operator+ implementation. >
#endif // __KERNEL__

#endif // __OFF_SHTL_SRV_H

<ShtlSrv.C*>=
<Read the literate code instead warning. >

#include <shtl/ShtlSrv.h>       // Exported interface. 
<Off shuttle server implementation dependencies. >

<Off shuttle server static members. >
<Off shuttle server global variables. >

<off_ShtlSrv::off_ShtlSrv implementation. >
<off_ShtlSrv::get_allocator implementation. >
<off_ShtlSrv::start implementation. >
<off_ShtlSrv::alloc and free implementation. >
<off_ShtlSrv::notify implementation. >
<off_ShtlSrv::operator<< implementation. >
<off_ShtlSrv::nameof implementation. >
<off_ShtlSrv::get_url implementation. >

Shuttle code is in shtl/Shtl.h and shtl/Shtl.C.

<Shtl.h*>=
<Read the literate code instead warning. >
#ifndef __OFF_SHTL_H
#define __OFF_SHTL_H 1

<Off shuttle dependencies. >

<Off shuttle flag bits. >
<Off shuttle server predefined properties numbers. >

#ifdef __KERNEL__
<Off shuttle. >
#endif // __KERNEL__

#ifdef __KERNEL__
// Inline methods for off_Shtl
//
<Off shuttle late dependencies. >

<off_Shtl::get_pc implementation. >
<off_Shtl::get_regs et al. implementation. >
<off_Shtl::get_next_regs implementation. >
<off_Shtl::set_uctx and set_kctx implementation. >
<off_Shtl::is_usrio implementation. >
<off_Shtl::get_prty and off_Shtl::set_prty implementation. >
<off_Shtl::get_dtlb and set_dtlb implementation. >
<off_Shtl::is_blocked implementation. >
<off_Shtl::is_yielding implementation. >
<off_Shtl::yields_to implementation. >
<off_Shtl::is_running et al. implementation. >
<off_Shtl::valid implementation. >
#endif // __KERNEL__

#endif // __OFF_SHTL_H

<Shtl.C*>=
<Read the literate code instead warning. >

#include <shtl/Shtl.h>          // Exported interface.
<Off shuttle implementation dependencies. >

<Off shuttle static members. >

<off_Shtl::off_Shtl implementation. >
<off_Shtl::self implementation. >
<off_Shtl::block and unblock implementation. >
<off_Shtl::yield implementation. >
<off_Shtl::def_prop implementation. >
<off_Shtl::set_prop implementation. >
<off_Shtl::get_allocator implementation. >
<off_Shtl::operator new implementation. >
<off_Shtl::operator delete implementation. >
<off_Shtl::switch_to implementation. >
<off_Shtl::get_url_holder implementation. >
<off_Shtl::usrio_enable and usrio_disable implementation. >
<off_Shtl::get_prop implementation. >

Shuttle property code is in ShtlProp.h and ShtlProp.C.

<ShtlProp.h*>=
<Read the literate code instead warning. >
#ifndef __OFF_SHTL_PROP_H
#define __OFF_SHTL_PROP_H 1

<Off shuttle property dependencies. >

<Off shuttle property identifer. >

#ifdef __KERNEL__
<Off shuttle property server. >
<Off shuttle property. >
<Off off-kernel shuttle property server. >
#endif // __KERNEL__

#ifdef __KERNEL__
<off_ShtlProp::set_val and get_val implementation. >
<off_ShtlProp::pswitch implementation. >
#endif // __KERNEL__

#endif // __OFF_SHTL_PROP_H

<ShtlProp.C*>=
<Read the literate code instead warning. >

#include <shtl/ShtlProp.h>      // Exported interface.
<Off shuttle property implementation dependencies. >

<off_ShtlProp::off_ShtlProp implementation. >
<off_ShtlProp::pset and pclr implementation. >
<off_ShtlProp::operator new implementation. >

The property allocator is in shtl/ShtlPropAllocator.h and shtl/ShtlPropAllocator.C.

<ShtlPropAllocator.h*>=
<Read the literate code instead warning. >
#ifndef __OFF_SHTL_PROP_ALLOC_H
#define __OFF_SHTL_PROP_ALLOC_H 1

<Off shuttle property allocator dependencies. >

#ifdef __KERNEL__
<Off shuttle property allocator. >
#endif // __KERNEL__

#endif // __OFF_SHTL_PROP_ALLOC_H

<ShtlPropAllocator.C*>=
<Read the literate code instead warning. >

#include <shtl/ShtlPropAllocator.h> // Exported interface.

<Off shuttle property allocator static members. >

\subsection{Shuttles for ix86 based architectures}

There is no machine dependent shuttle server code. However, a dummy machine dependent shuttle server is provided so that the node server could create the shuttle server as it does with remaining servers.

<Off machine dependent shuttle server. >= (U->)
// A machine dependent shuttle server.
//
class off_mdepShtlSrv {
public:
  static natural_t how_many(void) { return 1;}
  off_mdepShtlSrv(natural_t i) { (void)i; }
};

Defines off_mdepShtlSrv (links are to index).

<Off machine dependent shuttle server dependencies. >= (U->)
#include <flux/types.h>         // for boolean_t natural_t et al.

Machine dependent shuttles provide the low-level glue code and data needed to implement shuttles. We have seen most of the routines provided by mdepShtls.

<Off machine dependent shuttle. >= (U->)
// A machine dependent shuttle.
//
class off_mdepShtl {
public:
  // Finds the next register frame  in the shuttle stack
  off_ProcRegs *get_next_regs(const off_ProcRegs *r);

  // Enables user IO
  inline void usrio_enable(off_mdepProcRegs *r);
  // Disables user IO
  inline void usrio_disable(off_mdepProcRegs *r);

  // Sets the machine dependent protection domain for this dtlb.
  // NB: an off_dtlb_id_t must contain the dtlb cr3 as the offset on Intels. 
  inline void set_dtlb(natural_t dtlb_cr3);

  static natural_t get_sp(void)  { return get_esp(); }

  <Other public methods of off_mdepShtl. >
protected:
  <Other protected methods of off_mdepShtl. >
private:
  <Other private members of off_mdepShtl. >
};

Defines off_mdepShtl (links are to index).

<Off machine dependent shuttle dependencies. >= (U->) [D->]
#include <flux/machine/proc_reg.h> // for get_esp and get_eip.
#include <flux/types.h>         // for boolean_t natural_t et al.
class off_ProcRegs;

<Off machine dependent shuttle late dependencies. >= (U->)
#include <hw/Processor.h>       // for off_ProcRegs

\subsubsection{Support for hardwired properties}\label{sc:mdepsmpshtl}

To enable and disable user level IO we use the IOPL field in the eflags.

<off_mdepShtl::usrio_enable implementation. >= (U->)
// Enables user IO
inline void off_mdepShtl::usrio_enable(off_mdepProcRegs *r)
{
  r->p_ts.eflags |= EFL_IOPL_USER;
}

<off_mdepShtl::usrio_disable implementation. >= (U->)
// Disables user IO
inline void off_mdepShtl::usrio_disable(off_mdepProcRegs *r)
{
  r->p_ts.eflags &= ~EFL_IOPL_USER;
}

As of today, get_next_regs is not implemented.

<off_mdepShtl::get_next_regs implementation. >= (U->)
// Finds the next register frame  in the shuttle stack
off_ProcRegs *off_mdepShtl::get_next_regs(const off_ProcRegs *r)
{
  (void)r;
  return NULL;
}

<off_mdepShtl::set_dtlb implementation. >= (U->)
// Sets the machine dependent protection domain for this dtlb.
// NB: an off_dtlb_id_t must contain the dtlb cr3 as the offset on Intels. 
inline void off_mdepShtl::set_dtlb(natural_t dtlb_cr3)
{
  set_pdbr(dtlb_cr3);
}

<Off machine dependent shuttle dependencies. >+= (U->) [<-D->]
#include <flux/machine/paging.h> // for set_pdbr



 

Francisco J. Ballesteros
1998-05-25