Update mem_man.c while try to minimize code changes
Update MMgr interface (mainly c_stub.c)
       -- Use LL, cvect and cslab to track all aliased pages per page
Merged with Gabe's main repository

     -- llbooter is added in main repo
     -- Scripts change
     -- sched_hier is added
     -- many more...
Done with micro test on mem_mgr interface
Add the local recovery support for mem_mgr interface
No upcall yet
Many Makefiles are modified to avoid --gdb3 warning
There are still plenty of print messages to be removed later

TODO:
   Add upcall to support distributed recovery
-- When use -O3, gcc will optimize unsed register edi in CSTUB_FN
   Add volatile to force not so
-- Zero out any dynamically aloocated memory after crash
-- Add the introspect a few places to deal with reuse the page
-- Continue to work on upcall and do a little more detailed test
An interface (recovery_upcall) is added to the llbooter to facilitate
the replay of page aliases

Only mmgr and scheduler can invoke above new interface

A systemcall cos_upcall is changed to cos_upcall_args to help
differentiate the BOOTSTRAP and RECOVERY upcall_fn

Both mem_man.c and c_stcub.c are changed to abide by above changes

Only mmgr can introspect the kernel
1) Recovery upcall is working now with the simple test case (c0 alias to c1 and c2)
2) Support reuse of pages for memory manager itself
3) Change the test case so that upcall (recovery thread can rebuild both and revoke)
4) Make this commit and git push for code review 07/20/2012
1) Add the test cast which looks liek the following

                  --> c3
        c1 --> c2
                  --> c4

   where c1 gets the pages and aliased to c2. Then some pages aliased to
   c3 and other to c4.
2) Have tested the upcall functions with above test case, it works!
3) Need improve the list operation to some degree
1) Initial tests for MM recovery w/ upcalls have been done
2) Ready to move to the general kernel fault notification
1) A general failure detection machenism is added in the kernel for the
   following cases:

   a) invocation path (ipc_walk in inv.c)
   b) return path (pop in inv.c)
   c) context switch (switch_thread in inv.c)

   d) Another one is going to be added for interrupt case (TODO)

2) A 3-level pingpong test case is added to test above changes and it
   has tested the first 3 cases, using ip-8 hack for now.

3) remove old ping and pong in component/implementation
* Merge with main repository, including new fault handler
** need replace these ip-8 with new notif_handler

* Add recovery.h, in which the static inline functions are defined
  to support switching between non-FT and FT

* Modify cpu0 script to help develope scheduler FT
** scheduler interface has added prototype of FT support
Most changes are made for scheduler recovery

1) change the thread creation APIs so that the thread id is passed in
2) separate the thread creation and configuring parametes
3) all threads that created through scheduler is recorded in kerenl's
   schduler spd structure
4) recovery.h provides the function of thread_lookup
5) A doubly link list is created on thread DS to record the created
   threads (spd DS has the head and thread DS has the link)
6) cos_config.h file includes #define for enable/disable recovery
7) Scheduler initialization now has been tested and it will rebuild
   all threads that necessarry for initializtion, including idle thread,
   timer thread and iniitlizaiton thread in booter (test with cpu.sh)

Some changes are made for general fault detection in kernel
1) The new fault_notify handler has replaced the ip-8 hack and it is
   working now (tested with pinpong)

TODO:
1) Look at the threads that created and in the run queue -- rebuild the runqueue
2) Look at the fprr.c and rebuild (runquq, mapping, threads and event threads DS )
3) Finish all geenral fault detection related
Just a temporary anchor
  - Changes on scheduler and kernel
  - Able to record all threads created in scheduler
  - Able to replay the interface
  - Add changes on kernel fault notification
  - Able to introspect thread's id, prio, existence, etc.
  - Some other things, but just a temporary git log for in case
Commit before combine kernel fault notification and scheduler FT

Just a safe commit.
Just a check point

Working on updating both Context and POP
Another chkpt: now use ll notif when switch fault notified
chkpt: in switch, the target thread should do the work and replay?
chkpt: need figure out where to go (do what?) once fault_notif returns
check point: interrupt notification is tested and able to add interrup_handling now
chkpt: fix a few issues in previous scheduler FT code and retest
       Now sched_creat_thd is tested!!!
chkpt: ready to get some benchmark for scheduler and mmm