Rev 504 | Rev 534 | Go to most recent revision | Details | Compare with Previous | 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; |
||
532 | giacomo | 11 | extern void *OSD_current_pointer; |
498 | giacomo | 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 | |||
501 | giacomo | 58 | /* OSD_pointers |
532 | giacomo | 59 | |
60 | 00 - Fast Access |
||
61 | |||
504 | giacomo | 62 | 04 - Actual Chunk Position |
63 | 08 - Actual Chunk Start |
||
64 | 12 - Actual Chunk Size |
||
65 | 16 - Actual Chunk Emergency Size |
||
66 | 20 - Actual Chunk Flags |
||
501 | giacomo | 67 | |
532 | giacomo | 68 | 24 - Next Chunk OSD Pointer |
501 | giacomo | 69 | |
70 | */ |
||
71 | |||
72 | int FTrace_OSD_chunk_init(FTrace_Chunk_Ptr c, int size, int emergency_size, FTrace_flags flags) |
||
498 | giacomo | 73 | { |
74 | |||
532 | giacomo | 75 | *(DWORD *)(c->osd) = (DWORD)(c->osd + FTRACE_OSD_CHUNK_HEAD); |
498 | giacomo | 76 | |
501 | giacomo | 77 | *(DWORD *)(c->osd + 4) = (DWORD)(c->osd + FTRACE_OSD_CHUNK_HEAD); |
78 | *(DWORD *)(c->osd + 8) = (DWORD)(c->osd + FTRACE_OSD_CHUNK_HEAD); |
||
79 | *(DWORD *)(c->osd + 12) = (DWORD)(c->size); |
||
80 | *(DWORD *)(c->osd + 16) = (DWORD)(c->emergency_size); |
||
81 | *(DWORD *)(c->osd + 20) = (DWORD)(c->flags); |
||
82 | |||
498 | giacomo | 83 | *(DWORD *)(c->osd + 24) = 0; |
84 | |||
85 | return 0; |
||
86 | |||
87 | } |
||
88 | |||
89 | /* OSD Chunk Link */ |
||
532 | giacomo | 90 | int FTrace_OSD_chunk_link(FTrace_Chunk_Ptr a, FTrace_Chunk_Ptr b) |
498 | giacomo | 91 | { |
92 | |||
532 | giacomo | 93 | *(DWORD *)(a->osd + 24) = (DWORD)(b->osd); |
498 | giacomo | 94 | |
95 | return 0; |
||
96 | |||
97 | } |
||
98 | |||
503 | giacomo | 99 | int FTrace_OSD_update_chunk_flags(FTrace_Chunk_Ptr c) |
100 | { |
||
101 | |||
102 | *(DWORD *)(c->osd + 20) = (DWORD)(c->flags); |
||
103 | |||
104 | return 0; |
||
105 | |||
106 | } |
||
107 | |||
498 | giacomo | 108 | int FTrace_OSD_compress_chunk(int number, void *temp_data, int *data_size) |
109 | { |
||
110 | |||
111 | return 0; |
||
112 | |||
113 | } |
||
114 | |||
115 | int FTrace_OSD_send_chunk(int number, int osd_flag) |
||
116 | { |
||
117 | |||
118 | return 0; |
||
119 | |||
120 | } |
||
121 | |||
122 |