Path: blob/master/arch/microblaze/include/asm/processor.h
26442 views
/* SPDX-License-Identifier: GPL-2.0 */1/*2* Copyright (C) 2008-2009 Michal Simek <[email protected]>3* Copyright (C) 2008-2009 PetaLogix4* Copyright (C) 2006 Atmark Techno, Inc.5*/67#ifndef _ASM_MICROBLAZE_PROCESSOR_H8#define _ASM_MICROBLAZE_PROCESSOR_H910#include <asm/ptrace.h>11#include <asm/setup.h>12#include <asm/registers.h>13#include <asm/entry.h>14#include <asm/current.h>1516# ifndef __ASSEMBLY__17/* from kernel/cpu/mb.c */18extern const struct seq_operations cpuinfo_op;1920# define cpu_relax() barrier()2122#define task_pt_regs(tsk) \23(((struct pt_regs *)(THREAD_SIZE + task_stack_page(tsk))) - 1)2425/* Do necessary setup to start up a newly executed thread. */26void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long usp);2728extern void ret_from_fork(void);29extern void ret_from_kernel_thread(void);3031# endif /* __ASSEMBLY__ */3233/*34* This is used to define STACK_TOP, and with MMU it must be below35* kernel base to select the correct PGD when handling MMU exceptions.36*/37# define TASK_SIZE (CONFIG_KERNEL_START)3839/*40* This decides where the kernel will search for a free chunk of vm41* space during mmap's.42*/43# define TASK_UNMAPPED_BASE (TASK_SIZE / 8 * 3)4445# define THREAD_KSP 04647# ifndef __ASSEMBLY__4849/* If you change this, you must change the associated assembly-languages50* constants defined below, THREAD_*.51*/52struct thread_struct {53/* kernel stack pointer (must be first field in structure) */54unsigned long ksp;55unsigned long ksp_limit; /* if ksp <= ksp_limit stack overflow */56void *pgdir; /* root of page-table tree */57struct pt_regs *regs; /* Pointer to saved register state */58};5960# define INIT_THREAD { \61.ksp = sizeof init_stack + (unsigned long)init_stack, \62.pgdir = swapper_pg_dir, \63}6465unsigned long __get_wchan(struct task_struct *p);6667/* The size allocated for kernel stacks. This _must_ be a power of two! */68# define KERNEL_STACK_SIZE 0x20006970/* Return some info about the user process TASK. */71# define task_tos(task) ((unsigned long)(task) + KERNEL_STACK_SIZE)72# define task_regs(task) ((struct pt_regs *)task_tos(task) - 1)7374# define task_pt_regs_plus_args(tsk) \75((void *)task_pt_regs(tsk))7677# define task_sp(task) (task_regs(task)->r1)78# define task_pc(task) (task_regs(task)->pc)79/* Grotty old names for some. */80# define KSTK_EIP(task) (task_pc(task))81# define KSTK_ESP(task) (task_sp(task))8283# define STACK_TOP TASK_SIZE84# define STACK_TOP_MAX STACK_TOP8586#ifdef CONFIG_DEBUG_FS87extern struct dentry *of_debugfs_root;88#endif8990# endif /* __ASSEMBLY__ */91#endif /* _ASM_MICROBLAZE_PROCESSOR_H */929394