Data Structures | Defines | Functions | Variables

sw-host/syscoreshell.h File Reference

(r4864/r1008)

#include "defines.h"
#include <ctype.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include "xbasic_types.h"
#include "xio.h"
#include "xexception_l.h"
#include "xutil.h"
#include "xtime_l.h"
#include "xcache_l.h"
#include "xparameters.h"
#include "xuartlite_l.h"
#include <xuartlite.h>
#include "ddr_header.h"
#include "tapdev.h"
#include "ether.h"
#include "ip.h"
#include "arp.h"
#include "udp.h"
#include "crc32.h"
#include "sd_reader.h"
#include "flash_access.h"
Include dependency graph for syscoreshell.h:

Go to the source code of this file.

Data Structures

struct  sc_config
struct  SysCore_Message_Packet
struct  SysCoreProfile
struct  SysCore_Data_Packet
struct  SysCore_Data_Request
struct  sc_statistic
struct  sc_data

Defines

#define SYSCORE_VERSION   0x02000007
#define DEBUGLEVEL   0
#define NODE_FORBIDDEN   0
#define NODE_MASTER   1
#define NODE_CONTROL   2
#define NODE_OBSERVER   3
#define NODE_SKIP   4
#define SCP_HEADER_OFFSET   UDP_PAYLOAD_OFFSET
#define SCP_PAYLOAD_OFFSET   (SCP_HEADER_OFFSET + sizeof(struct SysCore_Message_Packet))
#define SCP_MESSAGE_ETHER_FRAME_SIZE   (SCP_PAYLOAD_OFFSET + 80)
#define MAX_SCP_PAYLOAD   MAX_UDP_PAYLOAD - sizeof(struct SysCore_Message_Packet)
#define StartProfile(name)
#define StopProfile(name, limit, label)
#define RESEND_MAX_SIZE   128
#define MASTER_DISCONNECT_TIME   500
#define LOCK_RELEASE_TIME   200

Functions

Xuint32 GetReg (int nodekind, Xuint32 addr, Xuint32 *retVal, Xuint8 *rawdata, Xuint32 *rawdatasize)
Xuint32 PutReg (int nodekind, Xuint32 addr, Xuint32 val, Xuint8 *rawdata)
int ethernetPacketDispatcher ()
void timer_set (XTime *timer, XTime timeoutMS)
Xuint8 timer_expired (XTime *timer)
void swap_byteorder (Xuint8 *target, Xuint16 bytes)
void sc_printf (const char *fmt,...)
void resetBuffers (int full)
void processDataRequest (struct SysCore_Data_Request *req)
void addSystemMessage (Xuint8 id, int flush)
void sendConsoleData (Xuint32 addr, void *data, unsigned payloadSize)
int overwriteSDFile ()

Variables

struct sc_config gC
char defConfigFileName []
Xuint8 global_file_buffer [ROC_ETH_FBUF_SIZE]
struct sc_data gD
struct sc_statistic gCnt

Define Documentation

#define DEBUGLEVEL   0

Definition at line 141 of file syscoreshell.h.

#define LOCK_RELEASE_TIME   200

Definition at line 349 of file syscoreshell.h.

#define MASTER_DISCONNECT_TIME   500

Definition at line 346 of file syscoreshell.h.

#define MAX_SCP_PAYLOAD   MAX_UDP_PAYLOAD - sizeof(struct SysCore_Message_Packet)

Definition at line 252 of file syscoreshell.h.

#define NODE_CONTROL   2

Definition at line 197 of file syscoreshell.h.

#define NODE_FORBIDDEN   0

Definition at line 195 of file syscoreshell.h.

#define NODE_MASTER   1

Definition at line 196 of file syscoreshell.h.

#define NODE_OBSERVER   3

Definition at line 198 of file syscoreshell.h.

#define NODE_SKIP   4

Definition at line 199 of file syscoreshell.h.

#define RESEND_MAX_SIZE   128

Definition at line 343 of file syscoreshell.h.

#define SCP_HEADER_OFFSET   UDP_PAYLOAD_OFFSET

Definition at line 249 of file syscoreshell.h.

#define SCP_MESSAGE_ETHER_FRAME_SIZE   (SCP_PAYLOAD_OFFSET + 80)

Definition at line 251 of file syscoreshell.h.

#define SCP_PAYLOAD_OFFSET   (SCP_HEADER_OFFSET + sizeof(struct SysCore_Message_Packet))

Definition at line 250 of file syscoreshell.h.

#define StartProfile (   name  ) 
Value:
static struct SysCoreProfile name = { 0, 0, 0, 0 }; \
   XTime_GetTime(&(name.tm1));

Definition at line 297 of file syscoreshell.h.

#define StopProfile (   name,
  limit,
  label 
)
Value:
XTime_GetTime(&(name.tm2)); \
   name.sum += (name.tm2 - name.tm1); \
   if (++name.cnt >= limit) { \
      int irate = (name.sum / name.cnt) * 1000; \
      int drate = irate % XPAR_CPU_PPC405_CORE_CLOCK_FREQ_HZ; \
      irate = irate / XPAR_CPU_PPC405_CORE_CLOCK_FREQ_HZ; \
      drate = (drate * 1000) / XPAR_CPU_PPC405_CORE_CLOCK_FREQ_HZ; \
      xil_printf(label" tm = %d us\r\n", irate*1000 + drate); \
      name.sum = 0; \
      name.cnt = 0; \
   }

Definition at line 301 of file syscoreshell.h.

#define SYSCORE_VERSION   0x02000007

Definition at line 138 of file syscoreshell.h.


Function Documentation

void addSystemMessage ( Xuint8  id,
int  flush 
)
int ethernetPacketDispatcher (  ) 
Xuint32 GetReg ( int  nodekind,
Xuint32  addr,
Xuint32 *  retVal,
Xuint8 *  rawdata,
Xuint32 *  rawdatasize 
)
int overwriteSDFile (  ) 
void processDataRequest ( struct SysCore_Data_Request req  ) 
Xuint32 PutReg ( int  nodekind,
Xuint32  addr,
Xuint32  val,
Xuint8 *  rawdata 
)
void resetBuffers ( int  full  ) 
void sc_printf ( const char *  fmt,
  ... 
)
void sendConsoleData ( Xuint32  addr,
void *  data,
unsigned  payloadSize 
)
void swap_byteorder ( Xuint8 *  target,
Xuint16  bytes 
)
Xuint8 timer_expired ( XTime *  timer  ) 
void timer_set ( XTime *  timer,
XTime  timeoutMS 
)

Variable Documentation

struct sc_config gC
struct sc_data gD
Xuint8 global_file_buffer[ROC_ETH_FBUF_SIZE]

Definition at line 226 of file syscoreshell.h.