Subversion Repositories shark

Rev

Rev 1063 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
352 giacomo 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Giacomo Guidi       <giacomo@gandalf.sssup.it>
10
 *
11
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
12
 *
13
 * http://www.sssup.it
14
 * http://retis.sssup.it
15
 * http://shark.sssup.it
16
 */
17
 
1063 tullio 18
/*
19
 * This program is free software; you can redistribute it and/or modify
20
 * it under the terms of the GNU General Public License as published by
21
 * the Free Software Foundation; either version 2 of the License, or
22
 * (at your option) any later version.
23
 *
24
 * This program is distributed in the hope that it will be useful,
25
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27
 * GNU General Public License for more details.
28
 *
29
 * You should have received a copy of the GNU General Public License
30
 * along with this program; if not, write to the Free Software
31
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
32
 *
33
 */
34
 
352 giacomo 35
#ifndef __TRACER_H__
36
#define __TRACER_H__
37
 
38
#ifdef __OLD_TRACER__
39
 
40
#include <ll/sys/types.h>
41
#include "types.h"
42
#include "trace.h"
355 giacomo 43
#include "FTrace.h"
352 giacomo 44
 
45
#define TRACER_LOGEVENT oldtrace
46
 
47
extern int (*trc_register_eventclass)
48
     (int class,int num,int(*func)(trc_event_t *, int event, void *ptr));
49
 
50
extern void (*trc_logevent)(int event, void *ptr);
51
 
52
extern int (*trc_resume)(void);
53
extern int (*trc_suspend)(void);
54
 
55
#define NOT_DEFINED 0xFF
56
 
710 giacomo 57
extern __inline__ void oldtrace(WORD type, WORD par1, DWORD par2)
352 giacomo 58
{
59
 
60
  static int oldtype;
61
  static int oldpar;
62
  extern BYTE conv[256]; // Conversion table: ctable.c
63
  BYTE ttype = 0;
64
 
710 giacomo 65
  ttype = type & 0x000F;
66
  type = (type >> 4) & 0x000F;
352 giacomo 67
  type |= (ttype << 4);
68
 
69
  oldtype = conv[type];
70
 
710 giacomo 71
  oldpar = par1;
72
 
352 giacomo 73
  if (oldtype != NOT_DEFINED) trc_logevent(oldtype,&oldpar);
74
 
75
}
76
 
77
 
78
#else
79
#ifdef __NEW_TRACER__
80
 
81
#include <ll/sys/types.h>
82
#include <ll/i386/hw-instr.h>
83
#include "FTrace.h"
497 giacomo 84
#include "FTrace_chunk.h"
85
#include "FTrace_OSD.h"
907 mauro 86
#include "FTrace_udp.h"
352 giacomo 87
 
497 giacomo 88
#define TRACER_NO_OUTPUT  0x00
89
#define TRACER_UDP_OUTPUT 0x01
364 giacomo 90
 
497 giacomo 91
#define TRACER_LOGEVENT FTrace_safe_ipoint
92
#define FAST_TRACER_LOGEVENT FTrace_unsafe_ipoint
352 giacomo 93
 
502 giacomo 94
void FTrace_unsafe_ipoint(WORD type, WORD par1, DWORD par2);
95
void FTrace_safe_ipoint(WORD type, WORD par1, DWORD par2);
362 giacomo 96
 
352 giacomo 97
#else
98
 
399 giacomo 99
#include "FTrace.h"
100
 
527 giacomo 101
#define TRACER_LOGEVENT(a,b,c)
352 giacomo 102
 
103
#endif
104
 
105
#endif
106
 
107
#endif