2 * include/asm-xtensa/coprocessor.h
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
8 * Copyright (C) 2003 - 2005 Tensilica Inc.
11 #ifndef _XTENSA_COPROCESSOR_H
12 #define _XTENSA_COPROCESSOR_H
14 #include <asm/variant/core.h>
15 #include <asm/variant/tie.h>
19 #define XTENSA_CP_EXTRA_OFFSET 0
20 #define XTENSA_CP_EXTRA_ALIGN 1 /* must be a power of 2 */
21 #define XTENSA_CP_EXTRA_SIZE 0
25 #define XTOFS(last_start,last_size,align) \
26 ((last_start+last_size+align-1) & -align)
28 #define XTENSA_CP_EXTRA_OFFSET 0
29 #define XTENSA_CP_EXTRA_ALIGN XCHAL_EXTRA_SA_ALIGN
31 #define XTENSA_CPE_CP0_OFFSET \
32 XTOFS(XTENSA_CP_EXTRA_OFFSET, XCHAL_EXTRA_SA_SIZE, XCHAL_CP0_SA_ALIGN)
33 #define XTENSA_CPE_CP1_OFFSET \
34 XTOFS(XTENSA_CPE_CP0_OFFSET, XCHAL_CP0_SA_SIZE, XCHAL_CP1_SA_ALIGN)
35 #define XTENSA_CPE_CP2_OFFSET \
36 XTOFS(XTENSA_CPE_CP1_OFFSET, XCHAL_CP1_SA_SIZE, XCHAL_CP2_SA_ALIGN)
37 #define XTENSA_CPE_CP3_OFFSET \
38 XTOFS(XTENSA_CPE_CP2_OFFSET, XCHAL_CP2_SA_SIZE, XCHAL_CP3_SA_ALIGN)
39 #define XTENSA_CPE_CP4_OFFSET \
40 XTOFS(XTENSA_CPE_CP3_OFFSET, XCHAL_CP3_SA_SIZE, XCHAL_CP4_SA_ALIGN)
41 #define XTENSA_CPE_CP5_OFFSET \
42 XTOFS(XTENSA_CPE_CP4_OFFSET, XCHAL_CP4_SA_SIZE, XCHAL_CP5_SA_ALIGN)
43 #define XTENSA_CPE_CP6_OFFSET \
44 XTOFS(XTENSA_CPE_CP5_OFFSET, XCHAL_CP5_SA_SIZE, XCHAL_CP6_SA_ALIGN)
45 #define XTENSA_CPE_CP7_OFFSET \
46 XTOFS(XTENSA_CPE_CP6_OFFSET, XCHAL_CP6_SA_SIZE, XCHAL_CP7_SA_ALIGN)
47 #define XTENSA_CP_EXTRA_SIZE \
48 XTOFS(XTENSA_CPE_CP7_OFFSET, XCHAL_CP7_SA_SIZE, 16)
53 * Tasks that own contents of (last user) each coprocessor.
54 * Entries are 0 for not-owned or non-existent coprocessors.
55 * Note: The size of this structure is fixed to 8 bytes in entry.S
58 struct task_struct *owner; /* owner */
59 int offset; /* offset in cpextra space. */
62 # define COPROCESSOR_INFO_OWNER 0
63 # define COPROCESSOR_INFO_OFFSET 4
64 # define COPROCESSOR_INFO_SIZE 8
67 #endif /* XCHAL_HAVE_CP */
73 extern void release_coprocessors (struct task_struct*);
74 extern void save_coprocessor_registers(void*, int);
76 # define release_coprocessors(task)
79 typedef unsigned char cp_state_t[XTENSA_CP_EXTRA_SIZE]
80 __attribute__ ((aligned (XTENSA_CP_EXTRA_ALIGN)));
82 #endif /* !__ASSEMBLY__ */
85 #endif /* _XTENSA_COPROCESSOR_H */