2 * The driver for the Cirrus Logic's Sound Fusion CS46XX based soundcards
3 * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 * NOTE: comments are copy/paste from cwcemb80.lst
22 * provided by Tom Woller at Cirrus (my only
23 * documentation about the SP OS running inside
27 #ifndef __CS46XX_DSP_TASK_TYPES_H__
28 #define __CS46XX_DSP_TASK_TYPES_H__
30 #include "cs46xx_dsp_scb_types.h"
32 /*********************************************************************************************
33 Example hierarchy of stream control blocks in the SP
38 -------+------ ------------- ------------- ------------- -----
39 | SBlaster IF |______\| Foreground |___\| Middlegr'nd |___\| Background |___\| Nul |
40 | |Goto /| tree header |g /| tree header |g /| tree header |g /| SCB |r
41 -------------- (g) ------------- ------------- ------------- -----
44 \/ ------------- ------------- -------------
45 | Foreground |_\ | Middlegr'nd |_\ | Background |_\
46 | tree |g/ | tree |g/ | tree |g/
47 ------------- ------------- -------------
52 *********************************************************************************************/
54 #define HFG_FIRST_EXECUTE_MODE 0x0001
55 #define HFG_FIRST_EXECUTE_MODE_BIT 0
56 #define HFG_CONTEXT_SWITCH_MODE 0x0002
57 #define HFG_CONTEXT_SWITCH_MODE_BIT 1
59 #define MAX_FG_STACK_SIZE 32 /* THESE NEED TO BE COMPUTED PROPERLY */
60 #define MAX_MG_STACK_SIZE 16
61 #define MAX_BG_STACK_SIZE 9
62 #define MAX_HFG_STACK_SIZE 4
64 #define SLEEP_ACTIVE_INCREMENT 0 /* Enable task tree thread to go to sleep
65 This should only ever be used on the Background thread */
66 #define STANDARD_ACTIVE_INCREMENT 1 /* Task tree thread normal operation */
67 #define SUSPEND_ACTIVE_INCREMENT 2 /* Cause execution to suspend in the task tree thread
68 This should only ever be used on the Background thread */
70 #define HOSTFLAGS_DISABLE_BG_SLEEP 0 /* Host-controlled flag that determines whether we go to sleep
73 /* Minimal context save area for Hyper Forground */
74 struct dsp_hf_save_area
{
79 ___DSP_DUAL_16BIT_ALLOC(
84 ___DSP_DUAL_16BIT_ALLOC(
93 ___DSP_DUAL_16BIT_ALLOC(
94 rsi2_save
, /* See TaskTreeParameterBlock for
95 remainder of registers */
98 /* saved as part of HFG context */
102 /* Task link data structure */
103 struct dsp_tree_link
{
104 ___DSP_DUAL_16BIT_ALLOC(
105 /* Pointer to sibling task control block */
107 /* Pointer to child task control block */
111 ___DSP_DUAL_16BIT_ALLOC(
112 /* Pointer to code entry point */
114 /* Pointer to local data */
120 struct dsp_task_tree_data
{
121 ___DSP_DUAL_16BIT_ALLOC(
122 /* Initial tock count; controls task tree execution rate */
124 /* Tock down counter */
128 /* Add to ActiveCount when TockCountLimit reached:
129 Subtract on task tree termination */
130 ___DSP_DUAL_16BIT_ALLOC(
132 /* Number of pending activations for task tree */
136 ___DSP_DUAL_16BIT_ALLOC(
137 /* BitNumber to enable modification of correct bit in ActiveTaskFlags */
139 /* Pointer to OS location for indicating current activity on task level */
140 active_task_flags_ptr
143 /* Data structure for controlling movement of memory blocks:-
145 ___DSP_DUAL_16BIT_ALLOC(
147 /* Data structure for controlling synchronous link update */
151 ___DSP_DUAL_16BIT_ALLOC(
152 /* Save area for remainder of full context. */
154 /* Address of start of local stack for data storage */
161 struct dsp_interval_timer_data
163 /* These data items have the same relative locations to those */
164 ___DSP_DUAL_16BIT_ALLOC(
165 interval_timer_period
,
169 /* used for this data in the SPOS control block for SPOS 1.0 */
170 ___DSP_DUAL_16BIT_ALLOC(
171 num_FG_ticks_this_interval
,
177 /* This structure contains extra storage for the task tree
178 Currently, this additional data is related only to a full context save */
179 struct dsp_task_tree_context_block
{
180 /* Up to 10 values are saved onto the stack. 8 for the task tree, 1 for
181 The access to the context switch (call or interrupt), and 1 spare that
182 users should never use. This last may be required by the system */
183 ___DSP_DUAL_16BIT_ALLOC(
187 ___DSP_DUAL_16BIT_ALLOC(
191 ___DSP_DUAL_16BIT_ALLOC(
195 ___DSP_DUAL_16BIT_ALLOC(
199 ___DSP_DUAL_16BIT_ALLOC(
206 /* Value may be overwriten by stack save algorithm.
207 Retain the size of the stack data saved here if used */
208 ___DSP_DUAL_16BIT_ALLOC(
212 u32 saverba
; /* (HFG) */
214 u32 savers_config_23
; /* (HFG) */
215 u32 savers_DMA23
; /* (HFG) */
239 u32 savershoutxmacmode
;
243 struct dsp_task_tree_control_block
{
244 struct dsp_hf_save_area context
;
245 struct dsp_tree_link links
;
246 struct dsp_task_tree_data data
;
247 struct dsp_task_tree_context_block context_blk
;
248 struct dsp_interval_timer_data int_timer
;
252 #endif /* __DSP_TASK_TYPES_H__ */