Merge master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb
[linux-2.6/mini2440.git] / include / asm-xtensa / coprocessor.h
bloba91b96dc0efedfc7df47eab3f20402267d5ec22c
1 /*
2 * include/asm-xtensa/cpextra.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
6 * for more details.
8 * Copyright (C) 2003 - 2005 Tensilica Inc.
9 */
11 #ifndef _XTENSA_COPROCESSOR_H
12 #define _XTENSA_COPROCESSOR_H
14 #include <xtensa/config/core.h>
16 #define XTOFS(last_start,last_size,align) \
17 ((last_start+last_size+align-1) & -align)
19 #define XTENSA_CP_EXTRA_OFFSET 0
20 #define XTENSA_CP_EXTRA_ALIGN XCHAL_EXTRA_SA_ALIGN
22 #define XTENSA_CPE_CP0_OFFSET \
23 XTOFS(XTENSA_CP_EXTRA_OFFSET, XCHAL_EXTRA_SA_SIZE, XCHAL_CP0_SA_ALIGN)
24 #define XTENSA_CPE_CP1_OFFSET \
25 XTOFS(XTENSA_CPE_CP0_OFFSET, XCHAL_CP0_SA_SIZE, XCHAL_CP1_SA_ALIGN)
26 #define XTENSA_CPE_CP2_OFFSET \
27 XTOFS(XTENSA_CPE_CP1_OFFSET, XCHAL_CP1_SA_SIZE, XCHAL_CP2_SA_ALIGN)
28 #define XTENSA_CPE_CP3_OFFSET \
29 XTOFS(XTENSA_CPE_CP2_OFFSET, XCHAL_CP2_SA_SIZE, XCHAL_CP3_SA_ALIGN)
30 #define XTENSA_CPE_CP4_OFFSET \
31 XTOFS(XTENSA_CPE_CP3_OFFSET, XCHAL_CP3_SA_SIZE, XCHAL_CP4_SA_ALIGN)
32 #define XTENSA_CPE_CP5_OFFSET \
33 XTOFS(XTENSA_CPE_CP4_OFFSET, XCHAL_CP4_SA_SIZE, XCHAL_CP5_SA_ALIGN)
34 #define XTENSA_CPE_CP6_OFFSET \
35 XTOFS(XTENSA_CPE_CP5_OFFSET, XCHAL_CP5_SA_SIZE, XCHAL_CP6_SA_ALIGN)
36 #define XTENSA_CPE_CP7_OFFSET \
37 XTOFS(XTENSA_CPE_CP6_OFFSET, XCHAL_CP6_SA_SIZE, XCHAL_CP7_SA_ALIGN)
38 #define XTENSA_CP_EXTRA_SIZE \
39 XTOFS(XTENSA_CPE_CP7_OFFSET, XCHAL_CP7_SA_SIZE, 16)
41 #if XCHAL_CP_NUM > 0
42 # ifndef __ASSEMBLY__
44 * Tasks that own contents of (last user) each coprocessor.
45 * Entries are 0 for not-owned or non-existent coprocessors.
46 * Note: The size of this structure is fixed to 8 bytes in entry.S
48 typedef struct {
49 struct task_struct *owner; /* owner */
50 int offset; /* offset in cpextra space. */
51 } coprocessor_info_t;
52 # else
53 # define COPROCESSOR_INFO_OWNER 0
54 # define COPROCESSOR_INFO_OFFSET 4
55 # define COPROCESSOR_INFO_SIZE 8
56 # endif
57 #endif
60 #ifndef __ASSEMBLY__
61 # if XCHAL_CP_NUM > 0
62 struct task_struct;
63 extern void release_coprocessors (struct task_struct*);
64 extern void save_coprocessor_registers(void*, int);
65 # else
66 # define release_coprocessors(task)
67 # endif
68 #endif
70 #endif /* _XTENSA_COPROCESSOR_H */