2019-08-25 10:49:19 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2005-04-16 15:20:36 -07:00
|
|
|
/*
|
2007-10-16 01:27:00 -07:00
|
|
|
* Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
|
2005-04-16 15:20:36 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __UM_PROCESSOR_GENERIC_H
|
|
|
|
#define __UM_PROCESSOR_GENERIC_H
|
|
|
|
|
|
|
|
struct pt_regs;
|
|
|
|
|
|
|
|
struct task_struct;
|
|
|
|
|
2012-10-08 03:27:32 +01:00
|
|
|
#include <asm/ptrace.h>
|
|
|
|
#include <sysdep/archsetjmp.h>
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-05-24 17:13:03 -07:00
|
|
|
#include <linux/prefetch.h>
|
|
|
|
|
2021-03-12 15:16:07 +00:00
|
|
|
#include <asm/cpufeatures.h>
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
struct mm_struct;
|
|
|
|
|
|
|
|
struct thread_struct {
|
|
|
|
struct pt_regs regs;
|
2013-09-23 17:38:02 +02:00
|
|
|
struct pt_regs *segv_regs;
|
2005-04-16 15:20:36 -07:00
|
|
|
int singlestep_syscall;
|
|
|
|
void *fault_addr;
|
2007-10-16 01:27:05 -07:00
|
|
|
jmp_buf *fault_catcher;
|
2005-04-16 15:20:36 -07:00
|
|
|
struct task_struct *prev_sched;
|
|
|
|
struct arch_thread arch;
|
2007-10-16 01:26:58 -07:00
|
|
|
jmp_buf switch_buf;
|
2005-04-16 15:20:36 -07:00
|
|
|
struct {
|
|
|
|
int op;
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
int pid;
|
|
|
|
} fork, exec;
|
|
|
|
struct {
|
|
|
|
int (*proc)(void *);
|
|
|
|
void *arg;
|
|
|
|
} thread;
|
|
|
|
struct {
|
|
|
|
void (*proc)(void *);
|
|
|
|
void *arg;
|
|
|
|
} cb;
|
|
|
|
} u;
|
|
|
|
} request;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define INIT_THREAD \
|
|
|
|
{ \
|
2007-10-16 01:27:00 -07:00
|
|
|
.regs = EMPTY_REGS, \
|
2005-04-16 15:20:36 -07:00
|
|
|
.fault_addr = NULL, \
|
|
|
|
.prev_sched = NULL, \
|
|
|
|
.arch = INIT_ARCH_THREAD, \
|
|
|
|
.request = { 0 } \
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* User space process size: 3GB (default).
|
|
|
|
*/
|
2008-02-08 04:22:07 -08:00
|
|
|
extern unsigned long task_size;
|
|
|
|
|
|
|
|
#define TASK_SIZE (task_size)
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-02-08 04:19:26 -08:00
|
|
|
#undef STACK_TOP
|
|
|
|
#undef STACK_TOP_MAX
|
|
|
|
|
|
|
|
extern unsigned long stacksizelim;
|
|
|
|
|
|
|
|
#define STACK_ROOM (stacksizelim)
|
|
|
|
#define STACK_TOP (TASK_SIZE - 2 * PAGE_SIZE)
|
|
|
|
#define STACK_TOP_MAX STACK_TOP
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
/* This decides where the kernel will search for a free chunk of vm
|
|
|
|
* space during mmap's.
|
|
|
|
*/
|
|
|
|
#define TASK_UNMAPPED_BASE (0x40000000)
|
|
|
|
|
|
|
|
extern void start_thread(struct pt_regs *regs, unsigned long entry,
|
|
|
|
unsigned long stack);
|
|
|
|
|
|
|
|
struct cpuinfo_um {
|
|
|
|
unsigned long loops_per_jiffy;
|
|
|
|
int ipi_pipe[2];
|
2021-03-12 15:16:07 +00:00
|
|
|
int cache_alignment;
|
|
|
|
union {
|
|
|
|
__u32 x86_capability[NCAPINTS + NBUGINTS];
|
|
|
|
unsigned long x86_capability_alignment;
|
|
|
|
};
|
2005-04-16 15:20:36 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct cpuinfo_um boot_cpu_data;
|
|
|
|
|
2023-01-12 23:49:07 -05:00
|
|
|
#define cpu_data(cpu) boot_cpu_data
|
2005-04-16 15:20:36 -07:00
|
|
|
#define current_cpu_data boot_cpu_data
|
2021-03-12 15:16:07 +00:00
|
|
|
#define cache_line_size() (boot_cpu_data.cache_alignment)
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2021-09-20 21:32:50 +00:00
|
|
|
extern unsigned long get_thread_reg(int reg, jmp_buf *buf);
|
2007-10-16 01:26:58 -07:00
|
|
|
#define KSTK_REG(tsk, reg) get_thread_reg(reg, &tsk->thread.switch_buf)
|
2021-09-29 15:02:14 -07:00
|
|
|
extern unsigned long __get_wchan(struct task_struct *p);
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2005-10-04 14:53:52 -04:00
|
|
|
#endif
|