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 typedef struct _hf_save_area_t
{
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 typedef struct _tree_link_t
{
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 typedef struct _task_tree_data_t
{
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 */
162 typedef struct _interval_timer_data_t
164 /* These data items have the same relative locations to those */
165 ___DSP_DUAL_16BIT_ALLOC(
166 interval_timer_period
,
170 /* used for this data in the SPOS control block for SPOS 1.0 */
171 ___DSP_DUAL_16BIT_ALLOC(
172 num_FG_ticks_this_interval
,
175 } interval_timer_data_t
;
178 /* This structure contains extra storage for the task tree
179 Currently, this additional data is related only to a full context save */
180 typedef struct _task_tree_context_block_t
{
181 /* Up to 10 values are saved onto the stack. 8 for the task tree, 1 for
182 The access to the context switch (call or interrupt), and 1 spare that
183 users should never use. This last may be required by the system */
184 ___DSP_DUAL_16BIT_ALLOC(
188 ___DSP_DUAL_16BIT_ALLOC(
192 ___DSP_DUAL_16BIT_ALLOC(
196 ___DSP_DUAL_16BIT_ALLOC(
200 ___DSP_DUAL_16BIT_ALLOC(
207 /* Value may be overwriten by stack save algorithm.
208 Retain the size of the stack data saved here if used */
209 ___DSP_DUAL_16BIT_ALLOC(
213 u32 saverba
; /* (HFG) */
215 u32 savers_config_23
; /* (HFG) */
216 u32 savers_DMA23
; /* (HFG) */
240 u32 savershoutxmacmode
;
241 } task_tree_context_block_t
;
244 typedef struct _task_tree_control_block_t
{
245 hf_save_area_t context
;
247 task_tree_data_t data
;
248 task_tree_context_block_t context_blk
;
249 interval_timer_data_t int_timer
;
250 } task_tree_control_block_t
;
253 #endif /* __DSP_TASK_TYPES_H__ */