]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - arch/frv/include/asm/processor.h
Merge remote-tracking branch 'regulator/fix/max77802' into regulator-linus
[mirror_ubuntu-artful-kernel.git] / arch / frv / include / asm / processor.h
CommitLineData
1da177e4
LT
1/* processor.h: FRV processor definitions
2 *
3 * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#ifndef _ASM_PROCESSOR_H
13#define _ASM_PROCESSOR_H
14
1da177e4
LT
15#include <asm/mem-layout.h>
16
17#ifndef __ASSEMBLY__
18/*
19 * Default implementation of macro that returns current
20 * instruction pointer ("program counter").
21 */
22#define current_text_addr() ({ __label__ _l; _l: &&_l;})
23
f6dc8c5b 24#include <linux/compiler.h>
1da177e4
LT
25#include <linux/linkage.h>
26#include <asm/sections.h>
27#include <asm/segment.h>
28#include <asm/fpu.h>
29#include <asm/registers.h>
30#include <asm/ptrace.h>
31#include <asm/current.h>
32#include <asm/cache.h>
33
34/* Forward declaration, a strange C thing */
35struct task_struct;
36
1da177e4
LT
37/*
38 * Bus types
39 */
40#define EISA_bus 0
1da177e4
LT
41
42struct thread_struct {
43 struct pt_regs *frame; /* [GR28] exception frame ptr for this thread */
44 struct task_struct *curr; /* [GR29] current pointer for this thread */
45 unsigned long sp; /* [GR1 ] kernel stack pointer */
46 unsigned long fp; /* [GR2 ] kernel frame pointer */
47 unsigned long lr; /* link register */
48 unsigned long pc; /* program counter */
49 unsigned long gr[12]; /* [GR16-GR27] */
50 unsigned long sched_lr; /* LR from schedule() */
51
52 union {
53 struct pt_regs *frame0; /* top (user) stack frame */
54 struct user_context *user; /* userspace context */
55 };
56} __attribute__((aligned(8)));
57
58extern struct pt_regs *__kernel_frame0_ptr;
59extern struct task_struct *__kernel_current_task;
60
61#endif
62
63#ifndef __ASSEMBLY__
64#define INIT_THREAD_FRAME0 \
65 ((struct pt_regs *) \
66 (sizeof(init_stack) + (unsigned long) init_stack - sizeof(struct user_context)))
67
68#define INIT_THREAD { \
69 NULL, \
70 (struct task_struct *) init_stack, \
71 0, 0, 0, 0, \
72 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, \
73 0, \
74 { INIT_THREAD_FRAME0 }, \
75}
76
77/*
78 * do necessary setup to start up a newly executed thread.
1da177e4
LT
79 */
80#define start_thread(_regs, _pc, _usp) \
81do { \
019f96a3
AV
82 _regs->pc = (_pc); \
83 _regs->psr &= ~PSR_S; \
84 _regs->sp = (_usp); \
1da177e4
LT
85} while(0)
86
1da177e4
LT
87/* Free all resources held by a thread. */
88static inline void release_thread(struct task_struct *dead_task)
89{
90}
91
1da177e4
LT
92extern asmlinkage void save_user_regs(struct user_context *target);
93extern asmlinkage void *restore_user_regs(const struct user_context *target, ...);
94
95#define copy_segments(tsk, mm) do { } while (0)
96#define release_segments(mm) do { } while (0)
97#define forget_segments() do { } while (0)
98
1da177e4
LT
99unsigned long get_wchan(struct task_struct *p);
100
101#define KSTK_EIP(tsk) ((tsk)->thread.frame0->pc)
102#define KSTK_ESP(tsk) ((tsk)->thread.frame0->sp)
103
f325f164 104#define cpu_relax() barrier()
1da177e4
LT
105
106/* data cache prefetch */
107#define ARCH_HAS_PREFETCH
108static inline void prefetch(const void *x)
109{
110 asm volatile("dcpl %0,gr0,#0" : : "r"(x));
111}
112
113#endif /* __ASSEMBLY__ */
114#endif /* _ASM_PROCESSOR_H */