-
Class Cyg_Thread
-
Class Cyg_HardwareThread
-
// Static class to provide common func.
Class Cyg_Scheduler
-
Class_Scheduler_Implementation
- Class Scheduler_Base
- Class Cyg_Scheduler_SchedLock
- // Current running thread
static Cyg_Thread * volatile current_thread[CYGNUM_KERNEL_CPU_MAX];
- static void unlock_inner(...);
- static void lock();
- static void unlock();
- static void reschedule();
- static unlock_reschedule();
- static unlock_simple();
- static void start();
- static void start_cpu();
- static Cyg_Scheduler scheduler;
- CYG_ADDRESS stack_base;
- cyg_uint32 stack_size;
- CYG_ADDRESS stack_ptr;
- cyg_thread_entry *entry_point;
- CYG_ADDRWORD entry_data;
-
HAL_SaveRegisters *saved_context;
- //eg: hal/gx/ck/arch/v3_0/include/hal_arch.h
typedef struct
{
...
) HAL_SaveRegisters;
- static void thread_entry( Cyg_Thread *thread);
- void attach_stack( CYG_ADDRESS stack, cyg_uint32 stack_size);
- CYG_ADDRESS detach_stack();
-
Class Cyg_SchedThread
-
Class Cyg_SchedThread_Implementation
- void register_thread(Cyg_Thread *thread);
-
Cyg_ThreadQueue *queue;
-
class Cyg_ThreadQueue
- Class Cyg_ThreadQueue_Implementation
-
Cyg_Thread(...
);
-
Cyg_Thread::Cyg_Thread(
CYG_ADDRWORD sched_info,
cyg_thread_entry *entry,
CYG_ADDRWORD entry_data,
char *name_arg,
CYG_ADDRESS stack_base,
cyg_ucount32 stack_size,
int static_stack
): Cyg_HardwareThread(entry, entry_data, stack_size, stack_base),
Cyg_SchedThread(this, sched_info),
timer(this)
{
...
}
- add_to_list();
- Cyg_Scheduler.register_thread(this);
- init_context(this);
- static Cyg_Thread *thread_list;
- Cyg_Thread *list_next;
- void add_to_list( void);
- void remove_from_list( void);
- static Cyg_Thread *get_list_head();
- Cyg_Thread *get_list_next();
-
mlqueue/bitmap/lottery
- Cyg_Scheduler_Implementation
- Cyg_SchedThread_Implementation
- Cyg_ThreadQueue_Implementation
-
Timer Interrupt principle
-
Cyg_RealTimeClock Cyg_RealTimeClock::rtc CYG_INIT_PRIORITY(CLOCK);
-
Class Cyg_Clock
-
Class Cyg_counter
- Cyg_Alarm_List alarm_list;
- Cyg_Counter::tick(count);
- {for(alarm_list) alarm->alarm();}
-
Cyg_Interrupt interrupt;
-
static cyg_uint32 isr(cyg_vector vector, CYG_ADDRWORD data);
- Almost do nothing, except call dsr
-
static void dsr(cyg_vector vector, cyg_ucount32 count, CYG_ADDRWORD data);
- {rtc->tick(count);}
-
Class Cyg_Thread : public Cyg_HardwareThread, public Cyg_SchedThread
-
Cyg_ThreadTimer timer;
- Class Cyg_Alarm
-
static void alarm( Cyg_Alarm *alarm, CYG_ADDRWORD data);
- {Cyg_Scheduler::unlock;}
- {Cyg_Scheduler::unlock_inner();}
- {CygInterrupt::call_pending_DSRs();}
- {HAL_THREAD_SWITCH_CONTEXT;}
- externC void cyg_thread_create(...);