49 lines
1.2 KiB
C
49 lines
1.2 KiB
C
/****************************************************************/
|
|
/* TMS320C32 */
|
|
/* ====== BIOS, ÊËÀÈÍ, ÊËÂÑÏ ====== */
|
|
/* ÖÍÈÈ ÑÝÒ (ñ) 1998-2001ã. */
|
|
/****************************************************************/
|
|
/* log_to_mem.h
|
|
****************************************************************
|
|
* Çàïèñü ëîãîâ â ïàìyòü *
|
|
****************************************************************/
|
|
|
|
#ifndef _LOG_TO_MEM
|
|
#define _LOG_TO_MEM
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* Îïðåäåëåíèa äëa ðàáîòû ëîããåðà */
|
|
#define LOG_PAGE_START 0x0200000
|
|
#define LOG_PAGE_LEN 0xF000
|
|
|
|
extern int no_write, never_write; // Ôëàãè, ÷òîáû íå ïèñàòü (åñëè ÷òî)
|
|
|
|
typedef struct
|
|
{
|
|
unsigned long Start;
|
|
unsigned long Finis;
|
|
unsigned long Adres;
|
|
unsigned int Circl;
|
|
|
|
} LOG;
|
|
|
|
extern LOG Log;
|
|
|
|
/* Çàïèñü ñëîâa â ïàìàòü, ãäå ëîãè ëåæàò */
|
|
#define Log_to_mem(x) *(int *)(Log.Adres++) = x
|
|
|
|
/* Ïðîâåðêà ãðàíèöû ïàìàòè äëà ëîãîâ */
|
|
#define Test_mem_limit(x) if(Log.Adres > (Log.Finis - x)) Log.Adres = Log.Start
|
|
|
|
/* Î÷èñòêà ïàìàòè (îáíóëåíèå) */
|
|
void clear_mem();
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* _LOG_TO_MEM */
|