#ifndef __traits_h #define __traits_h #include __BEGIN_SYS // Global Configuration template struct Traits { static const bool enabled = true; static const bool debugged = true; }; template <> struct Traits { enum {LIBRARY}; static const unsigned int MODE = LIBRARY; enum {IA32}; static const unsigned int ARCH = IA32; enum {PC}; static const unsigned int MACH = PC; }; // Utilities template <> struct Traits { static const bool error = true; static const bool warning = true; static const bool info = false; static const bool trace = false; }; template <> struct Traits: public Traits { static const bool debugged = false; }; template <> struct Traits: public Traits { static const bool debugged = false; }; template <> struct Traits: public Traits { }; // System Parts (mostly to fine control debbugin) template <> struct Traits: public Traits { }; template <> struct Traits: public Traits { }; template <> struct Traits: public Traits { }; // Common Mediators template <> struct Traits: public Traits { static const bool enabled = true; static const int COLUMNS = 80; static const int LINES = 24; static const int TAB_SIZE = 8; }; __END_SYS #include __ARCH_TRAITS_H #include __HEADER_MACH(config) #include __MACH_TRAITS_H __BEGIN_SYS template <> struct Traits: public Traits { static const unsigned int STACK_SIZE = 16 * 1024; static const unsigned int HEAP_SIZE = 16 * 1024 * 1024; }; template <> struct Traits: public Traits { static const unsigned int mode = Traits::MODE; static const bool multithread = true; static const bool multitask = false && (mode != Traits::LIBRARY); static const bool multicore = false && multithread; static const bool multiheap = (mode != Traits::LIBRARY) || Traits::enabled; enum {FOREVER = 0, SECOND = 1, MINUTE = 60, HOUR = 3600, DAY = 86400, WEEK = 604800, MONTH = 2592000, YEAR = 31536000}; static const unsigned long LIFE_SPAN = 1 * HOUR; // in seconds static const bool reboot = true; static const unsigned int STACK_SIZE = 4 * 1024; static const unsigned int HEAP_SIZE = 128 * Traits::STACK_SIZE; }; // Abstractions template <> struct Traits: public Traits { static const bool smp = Traits::multicore; typedef Scheduling_Criteria::EDF Criterion; static const unsigned int QUANTUM = 10000; // us static const bool trace_idle = false; }; template <> struct Traits: public Traits { static const bool enabled = Traits::multiheap; }; template <> struct Traits: public Traits { static const bool enabled = Traits::multiheap; }; template <> struct Traits: public Traits { static const bool visible = false; }; template <> struct Traits: public Traits { static const bool enabled = Traits::multithread; }; __END_SYS #endif