3
* Copyright (C) 2002, AVM GmbH. All rights reserved.
5
* This Software is free software. You can redistribute and/or
6
* modify such free software under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
10
* The free software is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this Software; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or see
18
* http://www.opensource.org/licenses/lgpl-license.html
20
* Contact: AVM GmbH, Alt-Moabit 95, 10559 Berlin, Germany, email: info@avm.de
23
#ifndef __have_image_h__
24
#define __have_image_h__
29
#define IMAGE_RELOC_ERROR -1
31
#define IMAGE_FREQUENCY 166665000
32
#define IMAGE_ADD_ROUND(x,y,z) ((((unsigned int) (x))+(y)+(z)-1)&~((z)-1))
33
#define XFER_INFO_MAX 1
35
/*---------------------------------------------------------------------------*\
36
\*---------------------------------------------------------------------------*/
37
typedef struct __img image_t, * image_p;
39
typedef enum __xfers {
48
typedef enum __xfert {
54
typedef struct __xferi {
59
#if defined (TM_TIMESTAMP)
62
} xfer_info_t, * xfer_info_p;
64
typedef struct __xferb {
69
xfer_info_t info[XFER_INFO_MAX];
71
} xfer_base_t, * xfer_base_p;
73
/*---------------------------------------------------------------------------*\
74
\*---------------------------------------------------------------------------*/
75
extern xfer_base_p tx_info;
76
extern xfer_base_p rx_info;
78
/*---------------------------------------------------------------------------*\
79
\*---------------------------------------------------------------------------*/
80
extern __attr2 image_p lib_init (void *, unsigned long, unsigned long,
81
unsigned long, void *, unsigned);
82
extern __attr2 void lib_remove (image_p *);
84
extern __attr2 const char * lib_error (int);
86
/*---------------------------------------------------------------------------*\
87
\*---------------------------------------------------------------------------*/
88
extern __attr2 int lib_reloc (image_p);
89
extern __attr2 int lib_patch (image_p, const char *, unsigned long);
90
extern __attr2 int lib_getsize (image_p, int *, int *);
91
extern __attr2 int lib_getimage (image_p, unsigned, unsigned);
92
extern __attr2 int lib_load_symtab (image_p);
93
extern __attr2 int lib_readsym (image_p, char *, unsigned long *);
94
extern __attr2 int lib_findsym (image_p, char *, unsigned long *);
95
extern __attr2 int lib_load (image_p);
97
/*---------------------------------------------------------------------------*\
98
\*---------------------------------------------------------------------------*/
99
extern __attr2 int xfer_info_init (xfer_base_p, xfer_type_t);
100
extern __attr2 void xfer_info_reset (xfer_base_p);
102
extern __attr2 void xfer_info_set (xfer_base_p, unsigned, xfer_info_p);
103
extern __attr2 void xfer_info_get (xfer_base_p, unsigned, xfer_info_p);
105
extern __attr2 void xfer_info_write (
113
extern __attr2 void xfer_info_read (
119
#if defined (TM_TIMESTAMP)
124
#define xfer_info_ptr(base) (&base.pinfo[0])
125
#define xfer_info_num(base) XFER_INFO_MAX
126
#define xfer_info_type(base) (base.type)
128
/*---------------------------------------------------------------------------*\
129
\*---------------------------------------------------------------------------*/