/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Process/processor support for the Hexagon architecture3*4* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.5*/67#ifndef _ASM_PROCESSOR_H8#define _ASM_PROCESSOR_H910#ifndef __ASSEMBLY__1112#include <asm/mem-layout.h>13#include <asm/registers.h>14#include <asm/hexagon_vm.h>1516/* task_struct, defined elsewhere, is the "process descriptor" */17struct task_struct;1819extern void start_thread(struct pt_regs *, unsigned long, unsigned long);2021/*22* thread_struct is supposed to be for context switch data.23* Specifically, to hold the state necessary to perform switch_to...24*/25struct thread_struct {26void *switch_sp;27};2829/*30* initializes thread_struct31* The only thing we have in there is switch_sp32* which doesn't really need to be initialized.33*/3435#define INIT_THREAD { \36}3738#define cpu_relax() __vmyield()3940/*41* Decides where the kernel will search for a free chunk of vm space during42* mmaps.43* See also arch_get_unmapped_area.44* Doesn't affect if you have MAX_FIXED in the page flags set though...45*46* Apparently the convention is that ld.so will ask for "unmapped" private47* memory to be allocated SOMEWHERE, but it also asks for memory explicitly48* via MAP_FIXED at the lower * addresses starting at VA=0x0.49*50* If the two requests collide, you get authentic segfaulting action, so51* you have to kick the "unmapped" base requests higher up.52*/53#define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE/3))545556#define task_pt_regs(task) \57((struct pt_regs *)(task_stack_page(task) + THREAD_SIZE) - 1)5859#define KSTK_EIP(tsk) (pt_elr(task_pt_regs(tsk)))60#define KSTK_ESP(tsk) (pt_psp(task_pt_regs(tsk)))6162extern unsigned long __get_wchan(struct task_struct *p);6364/* The following stuff is pretty HEXAGON specific. */6566/* This is really just here for __switch_to.67Offsets are pulled via asm-offsets.c */6869/*70* No real reason why VM and native switch stacks should be different.71* Ultimately this should merge. Note that Rev C. ABI called out only72* R24-27 as callee saved GPRs needing explicit attention (R29-31 being73* dealt with automagically by allocframe), but the current ABI has74* more, R16-R27. By saving more, the worst case is that we waste some75* cycles if building with the old compilers.76*/7778struct hexagon_switch_stack {79union {80struct {81unsigned long r16;82unsigned long r17;83};84unsigned long long r1716;85};86union {87struct {88unsigned long r18;89unsigned long r19;90};91unsigned long long r1918;92};93union {94struct {95unsigned long r20;96unsigned long r21;97};98unsigned long long r2120;99};100union {101struct {102unsigned long r22;103unsigned long r23;104};105unsigned long long r2322;106};107union {108struct {109unsigned long r24;110unsigned long r25;111};112unsigned long long r2524;113};114union {115struct {116unsigned long r26;117unsigned long r27;118};119unsigned long long r2726;120};121122unsigned long fp;123unsigned long lr;124};125126#endif /* !__ASSEMBLY__ */127128#endif129130131