⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 syslog.h

📁 基于ecos的redboot
💻 H
字号:
/* syslog.h
---------------------------------------------------------------------------
                 Copyright (c) 2002, 2003 Intel Corporation
						 All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. 
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution. 
* Neither the name of Intel Corporation nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission. 
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                      
---------------------------------------------------------------------------
system: IXDP2400
subsystem: BootMonitor
author: gvaddadi
revisions:
--------------------------------------------------------------------------
*/

#ifndef SYSLOG_H
#define SYSLOG_H

#include <cyg/hal/hal_ixdp2400.h> 

/* Second last 128 K byte block of flash*/
#define SYSLOG_START_ADDR   (SLOW_PORT_BASE + 0xFA0000) 
#define SYSLOG_SIZE         (128 * 1024) /*Log Size */ 
#define SYSLOG_VALID	    0x54525545 /*ascii value of TRUE*/

#define TYPE_ERROR		0x1
#define TYPE_WARNING	0x2
#define TYPE_DBGMSG1	0x3
#define TYPE_DBGMSG2	0x4
#define TYPE_DBGMSG3	0x5

#define MASTER_BM		0x1
#define MASTER_DIAG		0x2
#define MASTER_LINUX	0x3
#define MASTER_VX		0x4
#define SLAVE_BM		0x5
#define SLAVE_DIAG		0x6 
#define SLAVE_LINUX		0x7
#define SLAVE_VX		0x8

#define CNTRL_BLOCK_SIZE	12
#define SYSLOG_ENTRY_SIZE   0x40
#define FIRST_ENTRY_PTR	    (SYSLOG_START_ADDR + CNTRL_BLOCK_SIZE)

#define LOG_OFF         0

#define SYSLOG_OK	    1
#define SYSLOG_ERROR    0
#define SYSLOG_FULL     0
#define SYSLOG_EMPTY    2

//extern flash_program_buf((volatile unsigned char *)addr, char * buf, int len )

typedef struct syslog_info 
{
		unsigned char *last_entry;
		int	num_of_entries;

}SYSLOG_INFO;



typedef struct syslog_cntrl_block{

	
	
	/*The ASCII value of VALID which is SYSLOG_VALID is stored in cookie at 
     *the time of syslog initialization. Each time the log is accessed the 
     *Syslog_Util function will check this location for VALID. If it matches,
     *it assumes the log is not corrupted and continues. Else it informs the 
     *user that the log is corrupt and initializes the log again.
     */
	unsigned int cookie; 
    unsigned int rsvd1;
	unsigned int rsvd2;

	}SYSLOG_CNTRL_BLOCK;




typedef struct syslog_data
{
		int timestamp;
		unsigned char type;
		unsigned char source_comp ;
		unsigned short int error_code;
		char desc[56];
}SYSLOG_DATA;

void syslog_help(void);
int compute_last_logentry_ptr(SYSLOG_INFO *x);
void syslog_display(SYSLOG_DATA *x);
void flash_read(volatile unsigned char *addr,unsigned char *buf, int len);

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -