[PATCH] ia64: task_thread_info()

on ia64 thread_info is at the constant offset from task_struct and stack
is embedded into the same beast. Set __HAVE_THREAD_FUNCTIONS, made
task_thread_info() just add a constant.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Al Viro and committed by Linus Torvalds ab03591d 718d6114

+16 -7
+2 -2
arch/ia64/kernel/mca.c
··· 766 l = strlen(previous_current->comm); 767 snprintf(comm, sizeof(comm), "%s %*s %d", 768 current->comm, l, previous_current->comm, 769 - previous_current->thread_info->cpu); 770 } 771 memcpy(current->comm, comm, sizeof(current->comm)); 772 ··· 1423 struct task_struct *p = (struct task_struct *)((char *)mca_data + offset); 1424 struct thread_info *ti; 1425 memset(p, 0, KERNEL_STACK_SIZE); 1426 - ti = (struct thread_info *)((char *)p + IA64_TASK_SIZE); 1427 ti->flags = _TIF_MCA_INIT; 1428 ti->preempt_count = 1; 1429 ti->task = p;
··· 766 l = strlen(previous_current->comm); 767 snprintf(comm, sizeof(comm), "%s %*s %d", 768 current->comm, l, previous_current->comm, 769 + task_thread_info(previous_current)->cpu); 770 } 771 memcpy(current->comm, comm, sizeof(current->comm)); 772 ··· 1423 struct task_struct *p = (struct task_struct *)((char *)mca_data + offset); 1424 struct thread_info *ti; 1425 memset(p, 0, KERNEL_STACK_SIZE); 1426 + ti = task_thread_info(p); 1427 ti->flags = _TIF_MCA_INIT; 1428 ti->preempt_count = 1; 1429 ti->task = p;
+5 -5
arch/ia64/kernel/signal.c
··· 655 656 if (!t) 657 return; 658 - t->thread_info->sigdelayed.signo = signo; 659 - t->thread_info->sigdelayed.code = code; 660 - t->thread_info->sigdelayed.addr = addr; 661 - t->thread_info->sigdelayed.start_time = start_time; 662 - t->thread_info->sigdelayed.pid = pid; 663 wmb(); 664 set_tsk_thread_flag(t, TIF_SIGDELAYED); 665 }
··· 655 656 if (!t) 657 return; 658 + task_thread_info(t)->sigdelayed.signo = signo; 659 + task_thread_info(t)->sigdelayed.code = code; 660 + task_thread_info(t)->sigdelayed.addr = addr; 661 + task_thread_info(t)->sigdelayed.start_time = start_time; 662 + task_thread_info(t)->sigdelayed.pid = pid; 663 wmb(); 664 set_tsk_thread_flag(t, TIF_SIGDELAYED); 665 }
+9
include/asm-ia64/thread_info.h
··· 57 /* how to get the thread information struct from C */ 58 #define current_thread_info() ((struct thread_info *) ((char *) current + IA64_TASK_SIZE)) 59 #define alloc_thread_info(tsk) ((struct thread_info *) ((char *) (tsk) + IA64_TASK_SIZE)) 60 #else 61 #define current_thread_info() ((struct thread_info *) 0) 62 #define alloc_thread_info(tsk) ((struct thread_info *) 0) 63 #endif 64 #define free_thread_info(ti) /* nothing */ 65 66 #define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR 67 #define alloc_task_struct() ((task_t *)__get_free_pages(GFP_KERNEL, KERNEL_STACK_SIZE_ORDER))
··· 57 /* how to get the thread information struct from C */ 58 #define current_thread_info() ((struct thread_info *) ((char *) current + IA64_TASK_SIZE)) 59 #define alloc_thread_info(tsk) ((struct thread_info *) ((char *) (tsk) + IA64_TASK_SIZE)) 60 + #define task_thread_info(tsk) ((struct thread_info *) ((char *) (tsk) + IA64_TASK_SIZE)) 61 #else 62 #define current_thread_info() ((struct thread_info *) 0) 63 #define alloc_thread_info(tsk) ((struct thread_info *) 0) 64 + #define task_thread_info(tsk) ((struct thread_info *) 0) 65 #endif 66 #define free_thread_info(ti) /* nothing */ 67 + #define task_stack_page(tsk) ((void *)(tsk)) 68 + 69 + #define __HAVE_THREAD_FUNCTIONS 70 + #define setup_thread_stack(p, org) \ 71 + *task_thread_info(p) = *task_thread_info(org); \ 72 + task_thread_info(p)->task = (p); 73 + #define end_of_stack(p) (unsigned long *)((void *)(p) + IA64_RBS_OFFSET) 74 75 #define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR 76 #define alloc_task_struct() ((task_t *)__get_free_pages(GFP_KERNEL, KERNEL_STACK_SIZE_ORDER))