aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-xtensa/coprocessor.h
blob: 5093034723becd3df1ad1a7b2558097ad7230fb2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * include/asm-xtensa/coprocessor.h
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 *
 * Copyright (C) 2003 - 2005 Tensilica Inc.
 */

#ifndef _XTENSA_COPROCESSOR_H
#define _XTENSA_COPROCESSOR_H

#include <xtensa/config/core.h>

#define XTOFS(last_start,last_size,align) \
	((last_start+last_size+align-1) & -align)

#define XTENSA_CP_EXTRA_OFFSET	0
#define XTENSA_CP_EXTRA_ALIGN	XCHAL_EXTRA_SA_ALIGN

#define XTENSA_CPE_CP0_OFFSET	\
	XTOFS(XTENSA_CP_EXTRA_OFFSET, XCHAL_EXTRA_SA_SIZE, XCHAL_CP0_SA_ALIGN)
#define XTENSA_CPE_CP1_OFFSET	\
	XTOFS(XTENSA_CPE_CP0_OFFSET, XCHAL_CP0_SA_SIZE, XCHAL_CP1_SA_ALIGN)
#define XTENSA_CPE_CP2_OFFSET	\
	XTOFS(XTENSA_CPE_CP1_OFFSET, XCHAL_CP1_SA_SIZE, XCHAL_CP2_SA_ALIGN)
#define XTENSA_CPE_CP3_OFFSET	\
	XTOFS(XTENSA_CPE_CP2_OFFSET, XCHAL_CP2_SA_SIZE, XCHAL_CP3_SA_ALIGN)
#define XTENSA_CPE_CP4_OFFSET	\
	XTOFS(XTENSA_CPE_CP3_OFFSET, XCHAL_CP3_SA_SIZE, XCHAL_CP4_SA_ALIGN)
#define XTENSA_CPE_CP5_OFFSET	\
	XTOFS(XTENSA_CPE_CP4_OFFSET, XCHAL_CP4_SA_SIZE, XCHAL_CP5_SA_ALIGN)
#define XTENSA_CPE_CP6_OFFSET	\
	XTOFS(XTENSA_CPE_CP5_OFFSET, XCHAL_CP5_SA_SIZE, XCHAL_CP6_SA_ALIGN)
#define XTENSA_CPE_CP7_OFFSET	\
	XTOFS(XTENSA_CPE_CP6_OFFSET, XCHAL_CP6_SA_SIZE, XCHAL_CP7_SA_ALIGN)
#define XTENSA_CP_EXTRA_SIZE	\
	XTOFS(XTENSA_CPE_CP7_OFFSET, XCHAL_CP7_SA_SIZE, 16)

#if XCHAL_CP_NUM > 0
# ifndef __ASSEMBLY__
/*
 * Tasks that own contents of (last user) each coprocessor.
 * Entries are 0 for not-owned or non-existent coprocessors.
 * Note: The size of this structure is fixed to 8 bytes in entry.S
 */
typedef struct {
	struct task_struct *owner;	/* owner */
	int offset;			/* offset in cpextra space. */
} coprocessor_info_t;
# else
#  define COPROCESSOR_INFO_OWNER 0
#  define COPROCESSOR_INFO_OFFSET 4
#  define COPROCESSOR_INFO_SIZE 8
# endif
#endif


#ifndef __ASSEMBLY__
# if XCHAL_CP_NUM > 0
struct task_struct;
extern void release_coprocessors (struct task_struct*);
extern void save_coprocessor_registers(void*, int);
# else
#  define release_coprocessors(task)
# endif
#endif

#endif	/* _XTENSA_COPROCESSOR_H */