POK(kernelpart)
/home/jaouen/pok_official/pok/trunk/kernel/arch/ppc/thread.h
Go to the documentation of this file.
00001 /*
00002  *                               POK header
00003  * 
00004  * The following file is a part of the POK project. Any modification should
00005  * made according to the POK licence. You CANNOT use this file or a part of
00006  * this file is this part of a file for your own project
00007  *
00008  * For more information on the POK licence, please see our LICENCE FILE
00009  *
00010  * Please follow the coding guidelines described in doc/CODING_GUIDELINES
00011  *
00012  *                                      Copyright (c) 2007-2009 POK team 
00013  *
00014  * Created by julien on Thu Jan 15 23:34:13 2009 
00015  */
00016 
00017 
00018 #ifndef __POK_PPC_THREAD_H__
00019 #define __POK_PPC_THREAD_H__
00020 
00021 #include <types.h>
00022 
00023 typedef struct
00024 {
00025   uint32_t sp;
00026   uint32_t unused_lr;
00027 
00028   uint32_t cr;
00029   uint32_t r2;
00030   uint32_t r13;
00031   uint32_t r14;
00032   uint32_t r15;
00033 
00034   uint32_t r16;
00035   uint32_t r17;
00036   uint32_t r18;
00037   uint32_t r19;
00038   uint32_t r20;
00039   uint32_t r21;
00040   uint32_t r22;
00041   uint32_t r23;
00042   uint32_t r24;
00043   uint32_t r25;
00044   uint32_t r26;
00045   uint32_t r27;
00046   uint32_t r28;
00047   uint32_t r29;
00048   uint32_t r30;
00049   uint32_t r31;
00050 
00051   uint32_t pad;
00052 
00053   /* Previous frame.  */
00054   uint32_t back_chain;
00055   uint32_t lr;
00056 } context_t;
00057 
00058 typedef struct
00059 {
00060   uint32_t sp;
00061   uint32_t unused_lr;
00062   
00063   uint32_t cr; /* 8 */
00064   uint32_t r0;
00065   uint32_t r2; /* 16 */
00066   uint32_t r3;
00067   uint32_t r4;
00068   uint32_t r5;
00069   uint32_t r6; /* 32 */
00070   uint32_t r7;
00071   uint32_t r8;
00072   uint32_t r9;
00073   uint32_t r10; /* 48 */
00074   uint32_t r11;
00075   uint32_t r12;
00076   uint32_t r13;
00077   uint32_t ctr; /* 64 */
00078   uint32_t xer;
00079   uint32_t srr0;
00080   uint32_t srr1;
00081 
00082   /* Previous frame.  */
00083   uint32_t back_chain;
00084   uint32_t lr;
00085 
00086   /* For initial frame alignment.  */
00087   uint32_t pad0;
00088   uint32_t pad1;
00089 } volatile_context_t;
00090 
00091 uint32_t                pok_context_create(uint32_t id,
00092                                            uint32_t stack_size,
00093                                            uint32_t entry);
00094 
00095 void                    pok_context_switch(uint32_t* old_sp,
00096                                            uint32_t new_sp);
00097 
00098 
00099 #endif /* !__POK_PPC_THREAD_H__ */
00100