blob: 5e20f8d68673c7229b6b1f72414262c3b0754cd7 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001
2/*
3 *
Joe Perches475be4d2012-02-19 19:52:38 -08004 Copyright (c) Eicon Networks, 2002.
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 *
Joe Perches475be4d2012-02-19 19:52:38 -08006 This source file is supplied for the use with
7 Eicon Networks range of DIVA Server Adapters.
Linus Torvalds1da177e2005-04-16 15:20:36 -07008 *
Joe Perches475be4d2012-02-19 19:52:38 -08009 Eicon File Revision : 2.1
Linus Torvalds1da177e2005-04-16 15:20:36 -070010 *
Joe Perches475be4d2012-02-19 19:52:38 -080011 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2, or (at your option)
14 any later version.
Linus Torvalds1da177e2005-04-16 15:20:36 -070015 *
Joe Perches475be4d2012-02-19 19:52:38 -080016 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
18 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 See the GNU General Public License for more details.
Linus Torvalds1da177e2005-04-16 15:20:36 -070020 *
Joe Perches475be4d2012-02-19 19:52:38 -080021 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Linus Torvalds1da177e2005-04-16 15:20:36 -070024 *
25 */
26#ifndef __DIVA_SOFT_DSP_TASK_ENTRY_H__
27#define __DIVA_SOFT_DSP_TASK_ENTRY_H__
28/*
Joe Perches475be4d2012-02-19 19:52:38 -080029 The soft DSP image is described by binary header contained on begin of this
30 image:
31 OFFSET FROM IMAGE START | VARIABLE
32 ------------------------------------------------------------------------
33 DIVA_MIPS_TASK_IMAGE_LINK_OFFS | link to the next image
Linus Torvalds1da177e2005-04-16 15:20:36 -070034 ----------------------------------------------------------------------
Joe Perches475be4d2012-02-19 19:52:38 -080035 DIVA_MIPS_TASK_IMAGE_GP_OFFS | image gp register value, void*
Linus Torvalds1da177e2005-04-16 15:20:36 -070036 ----------------------------------------------------------------------
Joe Perches475be4d2012-02-19 19:52:38 -080037 DIVA_MIPS_TASK_IMAGE_ENTRY_OFFS | diva_mips_sdp_task_entry_t*
Linus Torvalds1da177e2005-04-16 15:20:36 -070038 ----------------------------------------------------------------------
Joe Perches475be4d2012-02-19 19:52:38 -080039 DIVA_MIPS_TASK_IMAGE_LOAD_ADDR_OFFS | image image start address (void*)
Linus Torvalds1da177e2005-04-16 15:20:36 -070040 ----------------------------------------------------------------------
Joe Perches475be4d2012-02-19 19:52:38 -080041 DIVA_MIPS_TASK_IMAGE_END_ADDR_OFFS | image image end address (void*)
Linus Torvalds1da177e2005-04-16 15:20:36 -070042 ----------------------------------------------------------------------
Joe Perches475be4d2012-02-19 19:52:38 -080043 DIVA_MIPS_TASK_IMAGE_ID_STRING_OFFS | image id string char[...];
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 ----------------------------------------------------------------------
Joe Perches475be4d2012-02-19 19:52:38 -080045*/
Linus Torvalds1da177e2005-04-16 15:20:36 -070046#define DIVA_MIPS_TASK_IMAGE_LINK_OFFS 0x6C
47#define DIVA_MIPS_TASK_IMAGE_GP_OFFS 0x70
48#define DIVA_MIPS_TASK_IMAGE_ENTRY_OFFS 0x74
49#define DIVA_MIPS_TASK_IMAGE_LOAD_ADDR_OFFS 0x78
50#define DIVA_MIPS_TASK_IMAGE_END_ADDR_OFFS 0x7c
51#define DIVA_MIPS_TASK_IMAGE_ID_STRING_OFFS 0x80
52/*
Joe Perches475be4d2012-02-19 19:52:38 -080053 This function is called in order to set GP register of this task
54 This function should be always called before any function of the
55 task is called
56*/
57typedef void (*diva_task_set_prog_gp_proc_t)(void *new_gp);
Linus Torvalds1da177e2005-04-16 15:20:36 -070058/*
Joe Perches475be4d2012-02-19 19:52:38 -080059 This function is called to clear .bss at task initialization step
60*/
61typedef void (*diva_task_sys_reset_proc_t)(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070062/*
Joe Perches475be4d2012-02-19 19:52:38 -080063 This function is called in order to provide GP of master call to
64 task, that will be used by calls from the task to the master
65*/
66typedef void (*diva_task_set_main_gp_proc_t)(void *main_gp);
Linus Torvalds1da177e2005-04-16 15:20:36 -070067/*
Joe Perches475be4d2012-02-19 19:52:38 -080068 This function is called to provide address of 'dprintf' function
69 to the task
70*/
Linus Torvalds1da177e2005-04-16 15:20:36 -070071typedef word (*diva_prt_proc_t)(char *, ...);
72typedef void (*diva_task_set_prt_proc_t)(diva_prt_proc_t fn);
73/*
Joe Perches475be4d2012-02-19 19:52:38 -080074 This function is called to set task PID
75*/
Linus Torvalds1da177e2005-04-16 15:20:36 -070076typedef void (*diva_task_set_pid_proc_t)(dword id);
77/*
Joe Perches475be4d2012-02-19 19:52:38 -080078 This function is called for run-time task init
79*/
Linus Torvalds1da177e2005-04-16 15:20:36 -070080typedef int (*diva_task_run_time_init_proc_t)(void*, dword);
81/*
Joe Perches475be4d2012-02-19 19:52:38 -080082 This function is called from system scheduler or from timer
83*/
Linus Torvalds1da177e2005-04-16 15:20:36 -070084typedef void (*diva_task_callback_proc_t)(void);
85/*
Joe Perches475be4d2012-02-19 19:52:38 -080086 This callback is used by task to get current time im mS
87*/
Linus Torvalds1da177e2005-04-16 15:20:36 -070088typedef dword (*diva_task_get_tick_count_proc_t)(void);
89typedef void (*diva_task_set_get_time_proc_t)(\
Joe Perches475be4d2012-02-19 19:52:38 -080090 diva_task_get_tick_count_proc_t fn);
Linus Torvalds1da177e2005-04-16 15:20:36 -070091typedef struct _diva_mips_sdp_task_entry {
Joe Perches475be4d2012-02-19 19:52:38 -080092 diva_task_set_prog_gp_proc_t set_gp_proc;
93 diva_task_sys_reset_proc_t sys_reset_proc;
94 diva_task_set_main_gp_proc_t set_main_gp_proc;
95 diva_task_set_prt_proc_t set_dprintf_proc;
96 diva_task_set_pid_proc_t set_pid_proc;
97 diva_task_run_time_init_proc_t run_time_init_proc;
98 diva_task_callback_proc_t task_callback_proc;
99 diva_task_callback_proc_t timer_callback_proc;
100 diva_task_set_get_time_proc_t set_get_time_proc;
101 void *last_entry_proc;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102} diva_mips_sdp_task_entry_t;
103/*
Joe Perches475be4d2012-02-19 19:52:38 -0800104 'last_entry_proc' should be set to zero and is used for future extensuios
105*/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106typedef struct _diva_mips_sw_task {
Joe Perches475be4d2012-02-19 19:52:38 -0800107 diva_mips_sdp_task_entry_t sdp_entry;
108 void *sdp_gp_reg;
109 void *own_gp_reg;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110} diva_mips_sw_task_t;
111#if !defined(DIVA_BRI2F_SDP_1_NAME)
112#define DIVA_BRI2F_SDP_1_NAME "sdp0.2q0"
113#endif
114#if !defined(DIVA_BRI2F_SDP_2_NAME)
115#define DIVA_BRI2F_SDP_2_NAME "sdp1.2q0"
116#endif
117#endif