/* * Copyright (C) 2004-2006 Atmel Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef __ASM_AVR32_THREAD_INFO_H #define __ASM_AVR32_THREAD_INFO_H #include <asm/page.h> #define THREAD_SIZE_ORDER 1 #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) #ifndef __ASSEMBLY__ #include <asm/types.h> struct task_struct; struct thread_info { struct task_struct *task; /* main task structure */ unsigned long flags; /* low level flags */ __u32 cpu; __s32 preempt_count; /* 0 => preemptable, <0 => BUG */ __u32 rar_saved; /* return address... */ __u32 rsr_saved; /* ...and status register saved by debug handler when setting up trampoline */ __u8 supervisor_stack[0]; }; #define INIT_THREAD_INFO(tsk) \ { \ .task = &tsk, \ .flags = 0, \ .cpu = 0, \ .preempt_count = INIT_PREEMPT_COUNT, \ } #define init_thread_info (init_thread_union.thread_info) #define init_stack (init_thread_union.stack) /* * Get the thread information struct from C. * We do the usual trick and use the lower end of the stack for this */
static inline struct thread_info *current_thread_info(void) { unsigned long addr = ~(THREAD_SIZE - 1); asm("and %0, sp" : "=r"(addr) : "0"(addr)); return (struct thread_info *)addr; }Contributors
Person | Tokens | Prop | Commits | CommitProp | |
haavard skinnemoen | haavard skinnemoen | 31 | 100.00% | 1 | 100.00% |
Total | 31 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
haavard skinnemoen | haavard skinnemoen | 204 | 86.08% | 4 | 40.00% |
david howells | david howells | 9 | 3.80% | 1 | 10.00% |
hans-christian egtvedt | hans-christian egtvedt | 8 | 3.38% | 1 | 10.00% |
stephane eranian | stephane eranian | 7 | 2.95% | 1 | 10.00% |
al viro | al viro | 7 | 2.95% | 1 | 10.00% |
richard weinberger | richard weinberger | 1 | 0.42% | 1 | 10.00% |
andreas dilger | andreas dilger | 1 | 0.42% | 1 | 10.00% |
Total | 237 | 100.00% | 10 | 100.00% |