Path: blob/master/arch/um/include/asm/processor-generic.h
10820 views
/*1* Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)2* Licensed under the GPL3*/45#ifndef __UM_PROCESSOR_GENERIC_H6#define __UM_PROCESSOR_GENERIC_H78struct pt_regs;910struct task_struct;1112#include "asm/ptrace.h"13#include "registers.h"14#include "sysdep/archsetjmp.h"1516#include <linux/prefetch.h>1718struct mm_struct;1920struct thread_struct {21struct task_struct *saved_task;22/*23* This flag is set to 1 before calling do_fork (and analyzed in24* copy_thread) to mark that we are begin called from userspace (fork /25* vfork / clone), and reset to 0 after. It is left to 0 when called26* from kernelspace (i.e. kernel_thread() or fork_idle(),27* as of 2.6.11).28*/29int forking;30struct pt_regs regs;31int singlestep_syscall;32void *fault_addr;33jmp_buf *fault_catcher;34struct task_struct *prev_sched;35unsigned long temp_stack;36jmp_buf *exec_buf;37struct arch_thread arch;38jmp_buf switch_buf;39int mm_count;40struct {41int op;42union {43struct {44int pid;45} fork, exec;46struct {47int (*proc)(void *);48void *arg;49} thread;50struct {51void (*proc)(void *);52void *arg;53} cb;54} u;55} request;56};5758#define INIT_THREAD \59{ \60.forking = 0, \61.regs = EMPTY_REGS, \62.fault_addr = NULL, \63.prev_sched = NULL, \64.temp_stack = 0, \65.exec_buf = NULL, \66.arch = INIT_ARCH_THREAD, \67.request = { 0 } \68}6970extern struct task_struct *alloc_task_struct_node(int node);7172static inline void release_thread(struct task_struct *task)73{74}7576extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);7778static inline void prepare_to_copy(struct task_struct *tsk)79{80}818283extern unsigned long thread_saved_pc(struct task_struct *t);8485static inline void mm_copy_segments(struct mm_struct *from_mm,86struct mm_struct *new_mm)87{88}8990#define init_stack (init_thread_union.stack)9192/*93* User space process size: 3GB (default).94*/95extern unsigned long task_size;9697#define TASK_SIZE (task_size)9899#undef STACK_TOP100#undef STACK_TOP_MAX101102extern unsigned long stacksizelim;103104#define STACK_ROOM (stacksizelim)105#define STACK_TOP (TASK_SIZE - 2 * PAGE_SIZE)106#define STACK_TOP_MAX STACK_TOP107108/* This decides where the kernel will search for a free chunk of vm109* space during mmap's.110*/111#define TASK_UNMAPPED_BASE (0x40000000)112113extern void start_thread(struct pt_regs *regs, unsigned long entry,114unsigned long stack);115116struct cpuinfo_um {117unsigned long loops_per_jiffy;118int ipi_pipe[2];119};120121extern struct cpuinfo_um boot_cpu_data;122123#define my_cpu_data cpu_data[smp_processor_id()]124125#ifdef CONFIG_SMP126extern struct cpuinfo_um cpu_data[];127#define current_cpu_data cpu_data[smp_processor_id()]128#else129#define cpu_data (&boot_cpu_data)130#define current_cpu_data boot_cpu_data131#endif132133134#define KSTK_REG(tsk, reg) get_thread_reg(reg, &tsk->thread.switch_buf)135extern unsigned long get_wchan(struct task_struct *p);136137#endif138139140