Path: blob/master/arch/openrisc/include/asm/processor.h
26481 views
/* SPDX-License-Identifier: GPL-2.0-or-later */1/*2* OpenRISC Linux3*4* Linux architectural port borrowing liberally from similar works of5* others. All original copyrights apply as per the original source6* declaration.7*8* OpenRISC implementation:9* Copyright (C) 2003 Matjaz Breskvar <[email protected]>10* Copyright (C) 2010-2011 Jonas Bonn <[email protected]>11* et al.12*/1314#ifndef __ASM_OPENRISC_PROCESSOR_H15#define __ASM_OPENRISC_PROCESSOR_H1617#include <asm/spr_defs.h>18#include <asm/page.h>19#include <asm/ptrace.h>2021#define STACK_TOP TASK_SIZE22#define STACK_TOP_MAX STACK_TOP23/* Kernel and user SR register setting */24#define KERNEL_SR (SPR_SR_DME | SPR_SR_IME | SPR_SR_ICE \25| SPR_SR_DCE | SPR_SR_SM)26#define USER_SR (SPR_SR_DME | SPR_SR_IME | SPR_SR_ICE \27| SPR_SR_DCE | SPR_SR_IEE | SPR_SR_TEE)2829/*30* User space process size. This is hardcoded into a few places,31* so don't change it unless you know what you are doing.32*/3334#define TASK_SIZE (0x80000000UL)3536/* This decides where the kernel will search for a free chunk of vm37* space during mmap's.38*/39#define TASK_UNMAPPED_BASE (TASK_SIZE / 8 * 3)4041#ifndef __ASSEMBLER__4243struct task_struct;4445struct thread_struct {46long fpcsr; /* Floating point control status register. */47};4849/*50* At user->kernel entry, the pt_regs struct is stacked on the top of the51* kernel-stack. This macro allows us to find those regs for a task.52* Notice that subsequent pt_regs stackings, like recursive interrupts53* occurring while we're in the kernel, won't affect this - only the first54* user->kernel transition registers are reached by this (i.e. not regs55* for running signal handler)56*/57#define user_regs(thread_info) (((struct pt_regs *)((unsigned long)(thread_info) + THREAD_SIZE - STACK_FRAME_OVERHEAD)) - 1)5859/*60* Dito but for the currently running task61*/6263#define task_pt_regs(task) user_regs(task_thread_info(task))6465#define INIT_SP (sizeof(init_stack) + (unsigned long) &init_stack)6667#define INIT_THREAD { }686970#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)71#define KSTK_ESP(tsk) (task_pt_regs(tsk)->sp)727374void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp);75unsigned long __get_wchan(struct task_struct *p);76void show_registers(struct pt_regs *regs);7778#define cpu_relax() barrier()7980#endif /* __ASSEMBLER__ */81#endif /* __ASM_OPENRISC_PROCESSOR_H */828384