4 * Copyright (C) 2009, 2012 Imagination Technologies.
6 * This program is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU General Public License version 2 as published by the
8 * Free Software Foundation.
10 * Explicit state save and restore routines forming part of the thread binary
11 * interface for META processors
16 /* These aren't generally useful to a user so for now, they arent publically available */
17 #define _TBIECH_DSPRAM_DUA_S 8
18 #define _TBIECH_DSPRAM_DUA_BITS 0x7f00
19 #define _TBIECH_DSPRAM_DUB_S 0
20 #define _TBIECH_DSPRAM_DUB_BITS 0x007f
23 * void *__TBIDspramSaveA( short DspramSizes, void *pExt )
27 .global ___TBIDspramSaveA
28 .type ___TBIDspramSaveA,function
31 SETL [A0StP++], D0.5, D1.5
34 /* D1Ar1 - Dspram Sizes
35 * A0.4 - Pointer to buffer
38 /* Save the specified amount of dspram DUA */
40 LSR D1Ar1, D1Ar1, #_TBIECH_DSPRAM_DUA_S
41 AND D1Ar1, D1Ar1, #(_TBIECH_DSPRAM_DUA_BITS >> _TBIECH_DSPRAM_DUA_S)
44 DL MOV D0Re0, [D0AR.0++]
45 DL MOV D0Ar6, [D0AR.0++]
46 DL MOV D0Ar4, [D0AR.0++]
47 DL MOV D0.5, [D0AR.0++]
48 MSETL [A0.3++], D0Re0, D0Ar6, D0Ar4, D0.5
52 GETL D0.5, D1.5, [--A0StP]
55 .size ___TBIDspramSaveA,.-___TBIDspramSaveA
58 * void *__TBIDspramSaveB( short DspramSizes, void *pExt )
61 .global ___TBIDspramSaveB
62 .type ___TBIDspramSaveB,function
65 SETL [A0StP++], D0.5, D1.5
68 /* D1Ar1 - Dspram Sizes
69 * A0.3 - Pointer to buffer
72 /* Save the specified amount of dspram DUA */
74 LSR D1Ar1, D1Ar1, #_TBIECH_DSPRAM_DUB_S
75 AND D1Ar1, D1Ar1, #(_TBIECH_DSPRAM_DUB_BITS >> _TBIECH_DSPRAM_DUB_S)
78 DL MOV D0Re0, [D0BR.0++]
79 DL MOV D0Ar6, [D0BR.0++]
80 DL MOV D0Ar4, [D0BR.0++]
81 DL MOV D0.5, [D0BR.0++]
82 MSETL [A0.3++], D0Re0, D0Ar6, D0Ar4, D0.5
86 GETL D0.5, D1.5, [--A0StP]
89 .size ___TBIDspramSaveB,.-___TBIDspramSaveB
92 * void *__TBIDspramRestoreA( short DspramSizes, void *pExt )
95 .global ___TBIDspramRestoreA
96 .type ___TBIDspramRestoreA,function
99 SETL [A0StP++], D0.5, D1.5
102 /* D1Ar1 - Dspram Sizes
103 * A0.3 - Pointer to buffer
106 /* Restore the specified amount of dspram DUA */
108 LSR D1Ar1, D1Ar1, #_TBIECH_DSPRAM_DUA_S
109 AND D1Ar1, D1Ar1, #(_TBIECH_DSPRAM_DUA_BITS >> _TBIECH_DSPRAM_DUA_S)
112 MGETL D0Re0, D0Ar6, D0Ar4, D0.5, [A0.3++]
113 DL MOV [D0AW.0++], D0Re0
114 DL MOV [D0AW.0++], D0Ar6
115 DL MOV [D0AW.0++], D0Ar4
116 DL MOV [D0AW.0++], D0.5
120 GETL D0.5, D1.5, [--A0StP]
123 .size ___TBIDspramRestoreA,.-___TBIDspramRestoreA
126 * void *__TBIDspramRestoreB( short DspramSizes, void *pExt )
129 .global ___TBIDspramRestoreB
130 .type ___TBIDspramRestoreB,function
131 ___TBIDspramRestoreB:
133 SETL [A0StP++], D0.5, D1.5
136 /* D1Ar1 - Dspram Sizes
137 * A0.3 - Pointer to buffer
140 /* Restore the specified amount of dspram DUA */
142 LSR D1Ar1, D1Ar1, #_TBIECH_DSPRAM_DUB_S
143 AND D1Ar1, D1Ar1, #(_TBIECH_DSPRAM_DUB_BITS >> _TBIECH_DSPRAM_DUB_S)
146 MGETL D0Re0, D0Ar6, D0Ar4, D0.5, [A0.3++]
147 DL MOV [D0BW.0++], D0Re0
148 DL MOV [D0BW.0++], D0Ar6
149 DL MOV [D0BW.0++], D0Ar4
150 DL MOV [D0BW.0++], D0.5
154 GETL D0.5, D1.5, [--A0StP]
157 .size ___TBIDspramRestoreB,.-___TBIDspramRestoreB