changeset 122:28f967578233

RVT compiles
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 31 Oct 2013 04:37:17 +0000
parents 15e972110527
children 595631eee4bc
files nuc-fw/cfgmagic/processconf.sh nuc-fw/riviera/rvt/Makefile nuc-fw/riviera/rvt/rvt_api.c nuc-fw/riviera/rvt/rvt_def_i.h nuc-fw/riviera/rvt/rvt_env.c nuc-fw/riviera/rvt/rvt_env.h nuc-fw/riviera/rvt/rvt_gen.h nuc-fw/riviera/rvt/rvt_task.c nuc-fw/serial/serialswitch.h
diffstat 9 files changed, 113 insertions(+), 89 deletions(-) [+]
line wrap: on
line diff
--- a/nuc-fw/cfgmagic/processconf.sh	Thu Oct 31 00:55:14 2013 +0000
+++ b/nuc-fw/cfgmagic/processconf.sh	Thu Oct 31 04:37:17 2013 +0000
@@ -15,6 +15,10 @@
 mk_export_list=
 m4_export_list=
 
+# some defaults
+RVTMUX_UART_port=IrDA
+RVTMUX_UART_baud=115200
+
 . ./build.conf
 
 if [ -z "$TARGET" ]
@@ -23,11 +27,28 @@
 	exit 1
 fi
 
+# Serial configuration
+case "$RVTMUX_UART_port" in
+	IrDA)
+		;;
+	MODEM)
+		CONFIG_RVTMUX_ON_MODEM=1
+		export_to_c CONFIG_RVTMUX_ON_MODEM
+		;;
+	*)
+		echo "Error: unknown RTVMUX_UART_port=$RTVMUX_UART_port" 1>&2
+		exit 1
+		;;
+esac
+
+TR_BAUD_CONFIG=TR_BAUD_$RVTMUX_UART_baud
+export_to_c TR_BAUD_CONFIG
+
 # Once we get some actual functionality, the following definitions
 # will likely depend on the target and feature configuration,
 # but for now all we have is a FreeNucleus RTOS demo.
 
-BUILD_COMPONENTS="nucdemo nucleus sprintf sysglue"
+BUILD_COMPONENTS="bsp nucdemo nucleus serial sprintf sysglue"
 export_to_mk BUILD_COMPONENTS
 
 BUILD_DEFAULT_IMAGE=ramImage
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nuc-fw/riviera/rvt/Makefile	Thu Oct 31 04:37:17 2013 +0000
@@ -0,0 +1,9 @@
+CC=	arm-elf-gcc
+CFLAGS=	-O2 -fno-builtin -mthumb-interwork -mthumb
+
+OBJS=	rvt_api.o rvt_env.o rvt_task.o
+
+all:	${OBJS}
+
+clean:
+	rm -f *.[oa] *errs
--- a/nuc-fw/riviera/rvt/rvt_api.c	Thu Oct 31 00:55:14 2013 +0000
+++ b/nuc-fw/riviera/rvt/rvt_api.c	Thu Oct 31 04:37:17 2013 +0000
@@ -17,15 +17,15 @@
 
 
 
-#include "rv/general.h"
-#include "rv/rv_general.h"
-#include "rvf/rvf_api.h"
-#include "rvm/rvm_use_id_list.h"
+#include "../rv/general.h"
+#include "../rv/rv_general.h"
+#include "../rvf/rvf_api.h"
+#include "../rvm/rvm_use_id_list.h"
 
-#include "rvt/rvt_gen.h"
-#include "rvt/rvt_def_i.h"
-#include "rvt/rvt_env.h"
-#include "rvt/rvt_env_i.h"
+#include "rvt_gen.h"
+#include "rvt_def_i.h"
+#include "rvt_env.h"
+#include "rvt_env_i.h"
 
 #include <string.h>
 
@@ -96,9 +96,9 @@
 
 T_RVT_RET
 rvt_send_trace_no_cpy(	T_RVT_BUFFER msg, 
-						T_RVT_USER_ID user_id, 
-						T_RVT_MSG_LG msg_length, 
-						T_RVT_FORMAT msg_format)
+			T_RVT_USER_ID user_id, 
+			T_RVT_MSG_LG msg_length, 
+			T_RVT_FORMAT msg_format)
 {
 	/* Shift the pointer back to write control values */
 	T_RVT_TRACE_RQST * req_msg = (T_RVT_TRACE_RQST * )((UINT8*)msg - RVT_HEADER_SIZE);
@@ -115,10 +115,10 @@
 	/* Add the id, size and format of the msg at the beginning */	
 	
 	req_msg->header.msg_id	= RVT_TRACE_RQST_ID;
-	req_msg->format			= msg_format;
-	req_msg->user_id		= user_id;
-	req_msg->msg_length		= msg_length;
-    
+	req_msg->format		= msg_format;
+	req_msg->user_id	= user_id;
+	req_msg->msg_length	= msg_length;
+
 	if (rvf_send_msg(rvt_addr_id, (void *) req_msg) != RVF_OK)
 	{
 		(rvt_lost_msg_cpt.bit_mask).count++;
@@ -140,12 +140,9 @@
 /*                                                                              */
 /********************************************************************************/
 T_RVT_RET rvt_send_trace_cpy (T_RVT_BUFFER msg, 
-						T_RVT_USER_ID user_id, 
-						T_RVT_MSG_LG msg_length, 
-						T_RVT_FORMAT msg_format)
-
-		
-
+				T_RVT_USER_ID user_id, 
+				T_RVT_MSG_LG msg_length, 
+				T_RVT_FORMAT msg_format)
 {
 	T_RVT_TRACE_RQST * req ;
 
@@ -167,7 +164,7 @@
 
  	/* Add the id, size and format of the msg at the beginning */	
 	req->header.msg_id	= RVT_TRACE_RQST_ID;
-	req->format			= msg_format;
+	req->format		= msg_format;
 	req->user_id		= user_id;
 	req->msg_length		= msg_length;
 
--- a/nuc-fw/riviera/rvt/rvt_def_i.h	Thu Oct 31 00:55:14 2013 +0000
+++ b/nuc-fw/riviera/rvt/rvt_def_i.h	Thu Oct 31 04:37:17 2013 +0000
@@ -17,9 +17,9 @@
 #ifndef __RVT_DEF_I_H__
 #define __RVT_DEF_I_H__
 
-#include "rvt/rvt_gen.h"
+#include "rvt_gen.h"
 
-#include "rvt/rvt_pool_size.h"	/* Stack & Memory Bank sizes definitions */
+#include "rvt_pool_size.h"	/* Stack & Memory Bank sizes definitions */
 
 /************************* Internal definitions **************************/
 
@@ -31,23 +31,23 @@
 #define RVT_END_OF_TABLE	{"", RVT_INVALID_HEADER, NULL}
 
 #define RVT_USER_ID_MAPPING { \
-								{"RV",		RVT_RV_HEADER,		NULL}, \
-								{"L1",		RVT_L1_HEADER,		NULL}, \
-								{"L23",		RVT_L23_HEADER,		NULL}, \
-								{"TM",		RVT_TM_HEADER,		NULL}, \
-								{"RNET",	RVT_RNET_HEADER,	NULL}, \
-								{"PROF",	RVT_PROF_HEADER,	NULL}, \
-								{"GTTBACK",	RVT_GTTBACK_HEADER,	NULL}, \
-								{"OTHER",	RVT_OTHER_HEADER,	NULL}, \
-								RVT_END_OF_TABLE \
-							}
+	{"RV",		RVT_RV_HEADER,		NULL}, \
+	{"L1",		RVT_L1_HEADER,		NULL}, \
+	{"L23",		RVT_L23_HEADER,		NULL}, \
+	{"TM",		RVT_TM_HEADER,		NULL}, \
+	{"RNET",	RVT_RNET_HEADER,	NULL}, \
+	{"PROF",	RVT_PROF_HEADER,	NULL}, \
+	{"GTTBACK",	RVT_GTTBACK_HEADER,	NULL}, \
+	{"OTHER",	RVT_OTHER_HEADER,	NULL}, \
+	RVT_END_OF_TABLE \
+}
 
 
 /* Trace task mailbox */
 #define RVT_TRACE_MAILBOX	RVF_TASK_MBOX_0
 
-typedef struct
-{	T_RVT_NAME			user_name[RVT_NAME_MAX_LEN];
+typedef struct {
+	T_RVT_NAME		user_name[RVT_NAME_MAX_LEN];
 	T_RVT_USER_ID		user_id;
 	RVT_CALLBACK_FUNC	rx_callback_func;
 } T_RVT_USER_DB;
@@ -56,12 +56,12 @@
 /* Define the unique message type used in RVT */
 #define RVT_TRACE_RQST_ID ( (RVT_USE_ID & 0xFFFF0000) | ( 0x1) | 0x001)
 
-typedef struct
-{	T_RV_HDR		header;
+typedef struct {
+	T_RV_HDR	header;
 	T_RVT_USER_ID	user_id;
 	T_RVT_FORMAT	format;
 	T_RVT_MSG_LG	msg_length;
-}	T_RVT_TRACE_RQST;
+} T_RVT_TRACE_RQST;
 
 
 /* Trace message header size */
@@ -70,8 +70,8 @@
 #define TRACE_TASK_STACK_SIZE TRACE_STACK_SIZE
 
 
-#define TRACE_MB_SIZE		      (TRACE_MB1_SIZE)
-#define TRACE_MB_WATERMARK	  (TRACE_MB_SIZE)
+#define TRACE_MB_SIZE		(TRACE_MB1_SIZE)
+#define TRACE_MB_WATERMARK	(TRACE_MB_SIZE)
 
 /* Decimal to hexadecimal conversion table */
 static const char Num2Char[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
--- a/nuc-fw/riviera/rvt/rvt_env.c	Thu Oct 31 00:55:14 2013 +0000
+++ b/nuc-fw/riviera/rvt/rvt_env.c	Thu Oct 31 04:37:17 2013 +0000
@@ -17,28 +17,25 @@
  *
  ********************************************************************************/
 
-#include "nucleus.h" 
+#include "../../include/config.h" 
 
 #include <string.h>
 
-#include "rvf/rvf_api.h"
-#include "rv/rv_general.h"
-#include "rvm/rvm_gen.h"
-#include "rvm/rvm_priorities.h"
+#include "../rvf/rvf_api.h"
+#include "../rv/rv_general.h"
+#include "../rvm/rvm_gen.h"
+#include "../rvm/rvm_priorities.h"
 
-#include "rvt/rvt_gen.h"
-#include "rvt/rvt_def_i.h"
-#include "rvt/rvt_env.h"
-#include "rvt/rvt_env_i.h"
-
-#include "rvm/rvm_use_id_list.h"
+#include "rvt_gen.h"
+#include "rvt_def_i.h"
+#include "rvt_env.h"
+#include "rvt_env_i.h"
 
-#include "uart/serialswitch.h"
+#include "../rvm/rvm_use_id_list.h"
 
-#ifndef _WINDOWS
-	#include "config/swconfig.cfg"
-	#include "config/debug.cfg"
-#endif
+#include "../../serial/serialswitch.h"
+
+#include "../../nucleus/nucleus.h"
 
 #define TI_RX_HISR_STACK_SIZE     (1024)
 static UINT8  TI_RX_HISR_stack[TI_RX_HISR_STACK_SIZE];
@@ -79,7 +76,7 @@
     return RVM_INVALID_PARAMETER;
 
   p_info_swe->swe_type                                  = RVM_SWE_TYPE_4;
-	
+
   p_info_swe->type_info.type4.swe_use_id                = RVT_USE_ID;
   p_info_swe->type_info.type4.version                   = 1;
   memcpy (p_info_swe->type_info.type4.swe_name,
@@ -99,7 +96,7 @@
           RVM_NAME_MAX_LEN);
   p_info_swe->type_info.type4.mem_bank[0].initial_params.size      = TRACE_MB_SIZE;
   p_info_swe->type_info.type4.mem_bank[0].initial_params.watermark = TRACE_MB_WATERMARK;
-	
+
   // Generic functions
   p_info_swe->type_info.type4.init     = rvt_init;
   p_info_swe->type_info.type4.core     = (T_RVM_SWE_CORE_FUNC)rvt_task_core;
--- a/nuc-fw/riviera/rvt/rvt_env.h	Thu Oct 31 00:55:14 2013 +0000
+++ b/nuc-fw/riviera/rvt/rvt_env.h	Thu Oct 31 04:37:17 2013 +0000
@@ -20,7 +20,7 @@
 #ifndef __RVT_ENV_H__
 #define __RVT_ENV_H__
 
-#include "rvm/rvm_gen.h"
+#include "../rvm/rvm_gen.h"
 
 
 typedef enum { RVT_NOT_STARTED,	RVT_STARTED	} T_RVT_STATE;
@@ -51,4 +51,4 @@
 rvt_kill (void);
 
 
-#endif /* __RVT_ENV_H__ */
\ No newline at end of file
+#endif /* __RVT_ENV_H__ */
--- a/nuc-fw/riviera/rvt/rvt_gen.h	Thu Oct 31 00:55:14 2013 +0000
+++ b/nuc-fw/riviera/rvt/rvt_gen.h	Thu Oct 31 04:37:17 2013 +0000
@@ -48,12 +48,12 @@
 
 /* Define return parameters.                                                     */
 typedef enum {
-	RVT_OK							= 0,
-	RVT_NOT_SUPPORTED				= -2,
-	RVT_NOT_READY					= -3,
-	RVT_MEMORY_ERR					= -4,
-	RVT_INTERNAL_ERR				= -9,
-	RVT_INVALID_PARAMETER			= -10
+	RVT_OK			= 0,
+	RVT_NOT_SUPPORTED	= -2,
+	RVT_NOT_READY		= -3,
+	RVT_MEMORY_ERR		= -4,
+	RVT_INTERNAL_ERR	= -9,
+	RVT_INVALID_PARAMETER	= -10
 } T_RVT_RET;
 
 
@@ -90,15 +90,15 @@
 
 T_RVT_RET
 rvt_send_trace_no_cpy(T_RVT_BUFFER p_buffer,
-					 T_RVT_USER_ID user_id,
-					 T_RVT_MSG_LG msg_lenght,
-					 T_RVT_FORMAT msg_format);
+			T_RVT_USER_ID user_id,
+			T_RVT_MSG_LG msg_lenght,
+			T_RVT_FORMAT msg_format);
 
 T_RVT_RET 
 rvt_send_trace_cpy(T_RVT_BUFFER msg,
-				  T_RVT_USER_ID user_id,
-				  T_RVT_MSG_LG msg_length,
-				  T_RVT_FORMAT msg_format);
+			T_RVT_USER_ID user_id,
+			T_RVT_MSG_LG msg_length,
+			T_RVT_FORMAT msg_format);
 
 
 T_RVT_RET
--- a/nuc-fw/riviera/rvt/rvt_task.c	Thu Oct 31 00:55:14 2013 +0000
+++ b/nuc-fw/riviera/rvt/rvt_task.c	Thu Oct 31 04:37:17 2013 +0000
@@ -19,23 +19,20 @@
 *
 ***************************************************************************/
 
-
-#include "nucleus.h"
+#include "../../include/config.h" 
 
-#include "rv/general.h"
-#include "rv/rv_general.h"
-#include "rvf/rvf_api.h"
-#include "rvt/rvt_gen.h"
-#include "rvt/rvt_def_i.h"
-#include "rvt/rvt_env.h"
-#include "rvt/rvt_env_i.h"
-#include "rvm/rvm_use_id_list.h"
+#include "../rv/general.h"
+#include "../rv/rv_general.h"
+#include "../rvf/rvf_api.h"
+#include "rvt_gen.h"
+#include "rvt_def_i.h"
+#include "rvt_env.h"
+#include "rvt_env_i.h"
+#include "../rvm/rvm_use_id_list.h"
 
-#include "uart/serialswitch.h"
+#include "../../serial/serialswitch.h"
 
-#ifndef _WINDOWS
-	#include "config/swconfig.cfg"
-#endif
+#include "../../nucleus/nucleus.h"
 
 #include <string.h>
 
@@ -245,7 +242,7 @@
 			} // End of if (event & (RVF_TIMER_0_EVT_MASK))
 		}
 	#else
-	
+
 		// Start the 'Alive Polling Timer'
 		#if (OP_WCP == 0)
 		  rvf_start_timer (RVF_TIMER_0,
--- a/nuc-fw/serial/serialswitch.h	Thu Oct 31 00:55:14 2013 +0000
+++ b/nuc-fw/serial/serialswitch.h	Thu Oct 31 04:37:17 2013 +0000
@@ -16,6 +16,9 @@
 #ifndef __SERIALSWITCH_H__
 #define __SERIALSWITCH_H__
 
+#include "../include/config.h"
+#include "../include/sys_types.h"
+
 #include "traceswitch.h"
 #include "faxdata.h"