Rev 501 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
498 | giacomo | 1 | #include <FTrace_chunk.h> |
2 | #include <FTrace_OSD.h> |
||
3 | #include <FTrace_types.h> |
||
4 | |||
5 | #include <kernel/kern.h> |
||
6 | #include <stdlib.h> |
||
7 | |||
8 | SYS_FLAGS FTracef; |
||
9 | |||
10 | extern FTrace_Chunk_Ptr ActualChunk; |
||
11 | extern BYTE OSD_pointers[FTRACE_OSD_CHUNK_HEAD]; |
||
12 | |||
13 | void FTrace_fsave() |
||
14 | { |
||
15 | |||
16 | FTracef = kern_fsave(); |
||
17 | |||
18 | } |
||
19 | |||
20 | void FTrace_frestore() |
||
21 | { |
||
22 | |||
23 | kern_frestore(FTracef); |
||
24 | |||
25 | } |
||
26 | |||
27 | void FTrace_lock() |
||
28 | { |
||
29 | |||
30 | } |
||
31 | |||
32 | void FTrace_unlock() |
||
33 | { |
||
34 | |||
35 | } |
||
36 | |||
37 | void *FTrace_malloc(int size) |
||
38 | { |
||
39 | |||
40 | return malloc(size); |
||
41 | |||
42 | } |
||
43 | |||
44 | void FTrace_free(void *ptr) |
||
45 | { |
||
46 | |||
47 | free(ptr); |
||
48 | |||
49 | } |
||
50 | |||
51 | int FTrace_OSD_init() |
||
52 | { |
||
53 | |||
54 | return 0; |
||
55 | |||
56 | } |
||
57 | |||
58 | int FTrace_OSD_chunk_init(FTrace_Chunk_Ptr c, int size, FTrace_flags flags) |
||
59 | { |
||
60 | |||
61 | *(DWORD *)(c->osd) = 0; |
||
62 | *(DWORD *)(c->osd + 4) = (DWORD)(c->sizemask); |
||
63 | *(DWORD *)(c->osd + 8) = (DWORD)(c->osd + 60); |
||
64 | *(DWORD *)(c->osd + 12) = 0; |
||
65 | *(DWORD *)(c->osd + 16) = 0; |
||
66 | |||
67 | *(DWORD *)(c->osd + 20) = 0; |
||
68 | *(DWORD *)(c->osd + 24) = 0; |
||
69 | *(DWORD *)(c->osd + 28) = 0; |
||
70 | *(DWORD *)(c->osd + 32) = 0; |
||
71 | *(DWORD *)(c->osd + 36) = 0; |
||
72 | |||
73 | *(DWORD *)(c->osd + 40) = 0; |
||
74 | *(DWORD *)(c->osd + 44) = 0; |
||
75 | *(DWORD *)(c->osd + 48) = 0; |
||
76 | *(DWORD *)(c->osd + 52) = 0; |
||
77 | *(DWORD *)(c->osd + 56) = 0; |
||
78 | |||
79 | return 0; |
||
80 | |||
81 | } |
||
82 | |||
83 | /* OSD Chunk Link */ |
||
84 | int FTrace_OSD_chunk_link(FTrace_Chunk_Ptr a, FTrace_Chunk_Ptr b, int osd_flags) |
||
85 | { |
||
86 | |||
87 | int delta = 0; |
||
88 | |||
89 | if (osd_flags == FTRACE_OSD_NEXT1) |
||
90 | delta = 20; |
||
91 | if (osd_flags == FTRACE_OSD_NEXT2) |
||
92 | delta = 40; |
||
93 | |||
94 | if (delta == 0) return -1; |
||
95 | |||
96 | memcpy((void *)(a->osd+delta),(void *)(b->osd),20); |
||
97 | |||
98 | return 0; |
||
99 | |||
100 | } |
||
101 | |||
102 | int FTrace_OSD_load_pointers() |
||
103 | { |
||
104 | |||
105 | if (ActualChunk == NULL) return -1; |
||
106 | |||
107 | memcpy((void *)OSD_pointers,(void *)ActualChunk->osd,FTRACE_OSD_CHUNK_HEAD); |
||
108 | |||
109 | return 0; |
||
110 | |||
111 | } |
||
112 | |||
113 | int FTrace_OSD_save_pointers() |
||
114 | { |
||
115 | |||
116 | if (ActualChunk == NULL) return -1; |
||
117 | |||
118 | memcpy((void *)ActualChunk->osd,(void *)OSD_pointers,FTRACE_OSD_CHUNK_HEAD); |
||
119 | |||
120 | return 0; |
||
121 | |||
122 | } |
||
123 | |||
124 | int FTrace_OSD_compress_chunk(int number, void *temp_data, int *data_size) |
||
125 | { |
||
126 | |||
127 | return 0; |
||
128 | |||
129 | } |
||
130 | |||
131 | int FTrace_OSD_send_chunk(int number, int osd_flag) |
||
132 | { |
||
133 | |||
134 | return 0; |
||
135 | |||
136 | } |
||
137 | |||
138 |