changeset 80:31384f415dae

created int_dummy.S with INT_*() functions for tcc.c
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 20 Jul 2018 07:36:23 +0000
parents 621b358b760d
children 4ab736fdbdba
files components/main src/cs/system/main/gcc/int_dummy.S
diffstat 2 files changed, 191 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/components/main	Fri Jul 20 06:51:54 2018 +0000
+++ b/components/main	Fri Jul 20 07:36:23 2018 +0000
@@ -88,7 +88,7 @@
 
 fi
 
-# exceptions.S for gcc
+# a couple of assembly modules for the gcc-built version
 
 if [ "$COMPILER" = gcc ]
 then
@@ -96,4 +96,5 @@
 	CPPFLAGS=
 
 	asm_file $SRCDIR/gcc/exceptions.S
+	asm_file $SRCDIR/gcc/int_dummy.S
 fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/cs/system/main/gcc/int_dummy.S	Fri Jul 20 07:36:23 2018 +0000
@@ -0,0 +1,189 @@
+/*
+ * This assembly module contains a few dummy INT_*() functions
+ * which are needed by Nucleus (tcc.c) but aren't used in TI's
+ * environment.  This code used to be in the big messy int.s
+ * assembly module in the original version.
+ */
+
+	.text
+	.code	32
+
+/*************************************************************************/
+/*                                                                       */
+/* FUNCTION                                                              */
+/*                                                                       */
+/*      INT_Vectors_Loaded                                               */
+/*                                                                       */
+/* DESCRIPTION                                                           */
+/*                                                                       */
+/*      This function returns the flag that indicates whether or not     */
+/*      all the default vectors have been loaded.  If it is false,       */
+/*      each LISR register also loads the ISR shell into the actual      */
+/*      vector table.                                                    */
+/*                                                                       */
+/* AUTHOR                                                                */
+/*                                                                       */
+/*      Barry Sellew, Accelerated Technology, Inc.                       */
+/*                                                                       */
+/* CALLED BY                                                             */
+/*                                                                       */
+/*      TCC_Register_LISR                   Register LISR for vector     */
+/*                                                                       */
+/* CALLS                                                                 */
+/*                                                                       */
+/*      None                                                             */
+/*                                                                       */
+/* INPUTS                                                                */
+/*                                                                       */
+/*      None                                                             */
+/*                                                                       */
+/* OUTPUTS                                                               */
+/*                                                                       */
+/*      None                                                             */
+/*                                                                       */
+/* HISTORY                                                               */
+/*                                                                       */
+/*         NAME            DATE                    REMARKS               */
+/*                                                                       */
+/*      B. Sellew       01-19-1996      Created initial version 1.0      */
+/*      B. Sellew       01-22-1996      Verified version 1.0             */
+/*                                                                       */
+/*************************************************************************/
+
+@INT    INT_Vectors_Loaded(void)
+@{
+	.globl	INT_Vectors_Loaded
+INT_Vectors_Loaded:
+@
+@    /* Just return the loaded vectors flag.  */
+@    return(INT_Loaded_Flag);
+@
+        MOV     a1,#1                       @ Always return TRUE since there 
+                                            @   are really only two normal 
+                                            @   vectors IRQ & FIQ
+        BX      lr                          @ Return to caller
+@}
+
+
+/*************************************************************************/
+/*                                                                       */
+/* FUNCTION                                                              */
+/*                                                                       */
+/*      INT_Setup_Vector                                                 */
+/*                                                                       */
+/* DESCRIPTION                                                           */
+/*                                                                       */
+/*      This function sets up the specified vector with the new vector   */
+/*      value.  The previous vector value is returned to the caller.     */
+/*                                                                       */
+/* AUTHOR                                                                */
+/*                                                                       */
+/*      Barry Sellew, Accelerated Technology, Inc.                       */
+/*                                                                       */
+/* CALLED BY                                                             */
+/*                                                                       */
+/*      Application                                                      */
+/*      TCC_Register_LISR                   Register LISR for vector     */
+/*                                                                       */
+/* CALLS                                                                 */
+/*                                                                       */
+/*      None                                                             */
+/*                                                                       */
+/* INPUTS                                                                */
+/*                                                                       */
+/*      vector                              Vector number to setup       */
+/*      new                                 Pointer to new assembly      */
+/*                                            language ISR               */
+/*                                                                       */
+/* OUTPUTS                                                               */
+/*                                                                       */
+/*      old vector contents                                              */
+/*                                                                       */
+/* HISTORY                                                               */
+/*                                                                       */
+/*         NAME            DATE                    REMARKS               */
+/*                                                                       */
+/*      B. Sellew       01-19-1996      Created initial version 1.0      */
+/*      B. Sellew       01-22-1996      Verified version 1.0             */
+/*                                                                       */
+/*************************************************************************/
+
+@VOID  *INT_Setup_Vector(INT vector, VOID *new)
+@{
+	.globl	INT_Setup_Vector
+INT_Setup_Vector:
+@
+@VOID    *old_vector;                        /* Old interrupt vector      */
+@VOID   **vector_table;                      /* Pointer to vector table   */
+@
+@    /* Calculate the starting address of the actual vector table.  */
+@    vector_table =  (VOID **) 0;
+@
+@    /* Pickup the old interrupt vector.  */
+@    old_vector =  vector_table[vector];
+@    
+@    /* Setup the new interrupt vector.  */
+@    vector_table[vector] =  new;
+@    
+@    /* Return the old interrupt vector.  */
+@    return(old_vector);
+@
+        MOV     a1,#0                       @ This routine is not applicable to
+                                            @   THUMB, return a NULL pointer
+        BX      lr                          @ Return to caller
+@}
+
+
+/*************************************************************************/
+/*                                                                       */
+/* FUNCTION                                                              */
+/*                                                                       */
+/*      INT_Retrieve_Shell                                               */
+/*                                                                       */
+/* DESCRIPTION                                                           */
+/*                                                                       */
+/*      This function retrieves the pointer to the shell interrupt       */
+/*      service routine.  The shell interrupt service routine calls      */
+/*      the LISR dispatch routine.                                       */
+/*                                                                       */
+/* AUTHOR                                                                */
+/*                                                                       */
+/*      Barry Sellew, Accelerated Technology, Inc.                       */
+/*                                                                       */
+/* CALLED BY                                                             */
+/*                                                                       */
+/*      TCC_Register_LISR                   Register LISR for vector     */
+/*                                                                       */
+/* CALLS                                                                 */
+/*                                                                       */
+/*      None                                                             */
+/*                                                                       */
+/* INPUTS                                                                */
+/*                                                                       */
+/*      vector                              Vector number to setup       */
+/*                                                                       */
+/* OUTPUTS                                                               */
+/*                                                                       */
+/*      shell pointer                                                    */
+/*                                                                       */
+/* HISTORY                                                               */
+/*                                                                       */
+/*         NAME            DATE                    REMARKS               */
+/*                                                                       */
+/*      B. Sellew       01-19-1996      Created initial version 1.0      */
+/*      B. Sellew       01-22-1996      Verified version 1.0             */
+/*                                                                       */
+/*************************************************************************/
+
+@VOID  *INT_Retrieve_Shell(INT vector)
+@{
+	.globl	INT_Retrieve_Shell
+INT_Retrieve_Shell:
+@
+@    /* Return the LISR Shell interrupt routine.  */
+@    return(INT_Vectors[vector]);
+@
+        MOV     a1,#0                       @ This routine is not applicable to
+                                            @   THUMB, return a NULL pointer
+        BX      lr                          @ Return to caller
+@}