18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * include/asm-alpha/processor.h
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 1994 Linus Torvalds
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef __ASM_ALPHA_PROCESSOR_H
98c2ecf20Sopenharmony_ci#define __ASM_ALPHA_PROCESSOR_H
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#include <linux/personality.h>	/* for ADDR_LIMIT_32BIT */
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci/*
148c2ecf20Sopenharmony_ci * We have a 42-bit user address space: 4TB user VM...
158c2ecf20Sopenharmony_ci */
168c2ecf20Sopenharmony_ci#define TASK_SIZE (0x40000000000UL)
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#define STACK_TOP \
198c2ecf20Sopenharmony_ci  (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL)
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#define STACK_TOP_MAX	0x00120000000UL
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci/* This decides where the kernel will search for a free chunk of vm
248c2ecf20Sopenharmony_ci * space during mmap's.
258c2ecf20Sopenharmony_ci */
268c2ecf20Sopenharmony_ci#define TASK_UNMAPPED_BASE \
278c2ecf20Sopenharmony_ci  ((current->personality & ADDR_LIMIT_32BIT) ? 0x40000000 : TASK_SIZE / 2)
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_citypedef struct {
308c2ecf20Sopenharmony_ci	unsigned long seg;
318c2ecf20Sopenharmony_ci} mm_segment_t;
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci/* This is dead.  Everything has been moved to thread_info.  */
348c2ecf20Sopenharmony_cistruct thread_struct { };
358c2ecf20Sopenharmony_ci#define INIT_THREAD  { }
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci/* Do necessary setup to start up a newly executed thread.  */
388c2ecf20Sopenharmony_cistruct pt_regs;
398c2ecf20Sopenharmony_ciextern void start_thread(struct pt_regs *, unsigned long, unsigned long);
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci/* Free all resources held by a thread. */
428c2ecf20Sopenharmony_cistruct task_struct;
438c2ecf20Sopenharmony_ciextern void release_thread(struct task_struct *);
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ciunsigned long get_wchan(struct task_struct *p);
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci#define KSTK_ESP(tsk) \
508c2ecf20Sopenharmony_ci  ((tsk) == current ? rdusp() : task_thread_info(tsk)->pcb.usp)
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci#define cpu_relax()	barrier()
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci#define ARCH_HAS_PREFETCH
558c2ecf20Sopenharmony_ci#define ARCH_HAS_PREFETCHW
568c2ecf20Sopenharmony_ci#define ARCH_HAS_SPINLOCK_PREFETCH
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci#ifndef CONFIG_SMP
598c2ecf20Sopenharmony_ci/* Nothing to prefetch. */
608c2ecf20Sopenharmony_ci#define spin_lock_prefetch(lock)  	do { } while (0)
618c2ecf20Sopenharmony_ci#endif
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ciextern inline void prefetch(const void *ptr)
648c2ecf20Sopenharmony_ci{
658c2ecf20Sopenharmony_ci	__builtin_prefetch(ptr, 0, 3);
668c2ecf20Sopenharmony_ci}
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ciextern inline void prefetchw(const void *ptr)
698c2ecf20Sopenharmony_ci{
708c2ecf20Sopenharmony_ci	__builtin_prefetch(ptr, 1, 3);
718c2ecf20Sopenharmony_ci}
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci#ifdef CONFIG_SMP
748c2ecf20Sopenharmony_ciextern inline void spin_lock_prefetch(const void *ptr)
758c2ecf20Sopenharmony_ci{
768c2ecf20Sopenharmony_ci	__builtin_prefetch(ptr, 1, 3);
778c2ecf20Sopenharmony_ci}
788c2ecf20Sopenharmony_ci#endif
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci#endif /* __ASM_ALPHA_PROCESSOR_H */
81