Rev 504 |
Rev 534 |
Go to most recent revision |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
#include <FTrace_chunk.h>
#include <FTrace_OSD.h>
#include <FTrace_types.h>
#include <kernel/kern.h>
#include <stdlib.h>
SYS_FLAGS FTracef
;
extern FTrace_Chunk_Ptr ActualChunk
;
extern void *OSD_current_pointer
;
void FTrace_fsave
()
{
FTracef
= kern_fsave
();
}
void FTrace_frestore
()
{
kern_frestore
(FTracef
);
}
void FTrace_lock
()
{
}
void FTrace_unlock
()
{
}
void *FTrace_malloc
(int size
)
{
return malloc(size
);
}
void FTrace_free
(void *ptr
)
{
free(ptr
);
}
int FTrace_OSD_init
()
{
return 0;
}
/* OSD_pointers
00 - Fast Access
04 - Actual Chunk Position
08 - Actual Chunk Start
12 - Actual Chunk Size
16 - Actual Chunk Emergency Size
20 - Actual Chunk Flags
24 - Next Chunk OSD Pointer
*/
int FTrace_OSD_chunk_init
(FTrace_Chunk_Ptr c
, int size
, int emergency_size
, FTrace_flags flags
)
{
*(DWORD
*)(c
->osd
) = (DWORD
)(c
->osd
+ FTRACE_OSD_CHUNK_HEAD
);
*(DWORD
*)(c
->osd
+ 4) = (DWORD
)(c
->osd
+ FTRACE_OSD_CHUNK_HEAD
);
*(DWORD
*)(c
->osd
+ 8) = (DWORD
)(c
->osd
+ FTRACE_OSD_CHUNK_HEAD
);
*(DWORD
*)(c
->osd
+ 12) = (DWORD
)(c
->size
);
*(DWORD
*)(c
->osd
+ 16) = (DWORD
)(c
->emergency_size
);
*(DWORD
*)(c
->osd
+ 20) = (DWORD
)(c
->flags
);
*(DWORD
*)(c
->osd
+ 24) = 0;
return 0;
}
/* OSD Chunk Link */
int FTrace_OSD_chunk_link
(FTrace_Chunk_Ptr a
, FTrace_Chunk_Ptr b
)
{
*(DWORD
*)(a
->osd
+ 24) = (DWORD
)(b
->osd
);
return 0;
}
int FTrace_OSD_update_chunk_flags
(FTrace_Chunk_Ptr c
)
{
*(DWORD
*)(c
->osd
+ 20) = (DWORD
)(c
->flags
);
return 0;
}
int FTrace_OSD_compress_chunk
(int number
, void *temp_data
, int *data_size
)
{
return 0;
}
int FTrace_OSD_send_chunk
(int number
, int osd_flag
)
{
return 0;
}