New demo files for HCS12 GCC port.

This commit is contained in:
Richard Barry 2006-05-27 13:53:15 +00:00
parent b6df57c7e3
commit 215d93aa3d
29 changed files with 3250 additions and 0 deletions

View file

@ -0,0 +1,73 @@
/* Interrupt Vectors
Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
Written by Stephane Carrez (stcarrez@nerim.fr)
This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
In addition to the permissions in the GNU General Public License, the
Free Software Foundation gives you unlimited permission to link the
compiled version of this file with other programs, and to distribute
those programs without any restriction coming from the use of this
file. (The General Public License restrictions do apply in other
respects; for example, they cover modification of the file, and
distribution when not linked into another program.)
This file is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _SYS_INTERRUPTS_H
#define _SYS_INTERRUPTS_H
#include <sys/param.h>
#ifdef mc6811
//# include <asm-m68hc11/interrupts.h>
#endif
#ifdef mc68hcs12
# include <asm-m68hcs12/interrupts.h>
#elif defined(mc6812)
//# include <asm-m68hc12/interrupts.h>
#endif
/*! Install an interrupt handler.
Install the interrupt handler for an exception. The handler
is installed for \b bootstrap mode and also for \b normal operating
mode.
@param id the interrupt number to be installed
@param handler the interrupt handler entry point
*/
extern void
set_interrupt_handler (interrupt_vector_id id, interrupt_t handler);
/*! Default and fatal interrupt handler.
This function is an interrupt handler intended to be used to
handle all interrupt not used by a program. Since it is an
error to have an interrupt when it is not handled, the default
behavior is to print a message and stop. */
extern void __attribute__((interrupt, noreturn))
fatal_interrupt (void);
#include <arch/interrupts.h>
/*! Entry point of any program.
This function should never be called by itself. It represents the
entry point of any program. It is intended to be used in an
interrupt table to specify the function to jump to after reset. */
extern void _start (void);
#endif

View file

@ -0,0 +1,56 @@
/* param.h - Board specific parameters
Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
Written by Stephane Carrez (stcarrez@nerim.fr)
This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
In addition to the permissions in the GNU General Public License, the
Free Software Foundation gives you unlimited permission to link the
compiled version of this file with other programs, and to distribute
those programs without any restriction coming from the use of this
file. (The General Public License restrictions do apply in other
respects; for example, they cover modification of the file, and
distribution when not linked into another program.)
This file is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _SYS_PARAM_H
#define _SYS_PARAM_H
/*! Attribute unused.
Use this attribute to indicate that a parameter, a variable or a
static function is not used. The compiler will not warn about the
unused variable. */
#define ATTRIBUTE_UNUSED __attribute__((unused))
/*! Attribute page0.
Use this attribute to put a global or static variable in page0. */
#define PAGE0_ATTRIBUTE __attribute__((section(".page0")))
#ifdef mc6811
//# include <asm-m68hc11/param.h>
#endif
#ifdef mc68hcs12
# include <asm-m68hcs12/param.h>
#elif defined(mc6812)
//# include <asm-m68hc12/param.h>
#endif
#include <arch/param.h>
#define GNU_LINKER_WARNING(SYMBOL, MSG) \
asm (".section .gnu.warning." SYMBOL "\n\t.string \"" MSG "\"\n\t.previous");
#endif

View file

@ -0,0 +1,69 @@
/* sys/ports.h -- Definition of system ports
Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
Written by Stephane Carrez (stcarrez@worldnet.fr)
This file is part of GEL.
GEL is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GEL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GEL; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _SYS_PORTS_H
#define _SYS_PORTS_H
#ifdef __cplusplus
extern "C" {
#endif
extern unsigned short get_timer_counter (void);
extern void set_timer_counter (unsigned short);
extern unsigned short get_input_capture_1 (void);
extern void set_input_capture_1 (unsigned short);
extern unsigned short get_input_capture_2 (void);
extern void set_input_capture_2 (unsigned short);
extern unsigned short get_input_capture_3 (void);
extern void set_input_capture_3 (unsigned short);
extern unsigned short get_output_compare_1 (void);
extern void set_output_compare_1 (unsigned short);
extern unsigned short get_output_compare_2 (void);
extern void set_output_compare_2 (unsigned short);
extern unsigned short get_output_compare_3 (void);
extern void set_output_compare_3 (unsigned short);
extern unsigned short get_output_compare_4 (void);
extern void set_output_compare_4 (unsigned short);
extern unsigned short get_output_compare_5 (void);
extern void set_output_compare_5 (unsigned short);
extern void set_bus_expanded (void);
extern void set_bus_single_chip (void);
extern void cop_reset (void);
extern void cop_optional_reset (void);
extern void timer_acknowledge (void);
extern void timer_initialize_rate (unsigned char);
#ifdef mc6811
//# include <asm-m68hc11/ports.h>
#endif
#ifdef mc68hcs12
# include <asm-m68hcs12/ports.h>
#elif defined(mc6812)
//# include <asm-m68hc12/ports.h>
#endif
#ifdef __cplusplus
};
#endif
#endif /* _SYS_PORTS_H */

View file

@ -0,0 +1,36 @@
/* sys/ports_def.h -- Definition of system ports
Copyright 2000 Free Software Foundation, Inc.
Written by Stephane Carrez (stcarrez@worldnet.fr)
This file is part of GEL.
GEL is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GEL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GEL; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _SYS_PORTS_DEF_H
#define _SYS_PORTS_DEF_H
#ifdef mc6811
//# include <asm-m68hc11/ports_def.h>
#endif
#ifdef mc68hcs12
# include <asm-m68hcs12/ports_def.h>
#elif defined(mc6812)
//# include <asm-m68hc12/ports_def.h>
#endif
#endif /* _SYS_PORTS_DEF_H */

View file

@ -0,0 +1,80 @@
/* sys/sio.h -- Utility methods to read/write the SIO
Copyright 2000 Free Software Foundation, Inc.
Written by Stephane Carrez (stcarrez@worldnet.fr)
This file is part of GEL.
GEL is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GEL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GEL; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _SYS_SIO_H
#define _SYS_SIO_H
#include <sys/param.h>
#include <sys/ports.h>
#ifdef __cplusplus
extern "C" {
#endif
extern void serial_init (void);
/* Return != 0 if there is something to read on the serial line. */
extern unsigned char serial_receive_pending (void);
/* Wait until the SIO has finished to send the character. */
extern void serial_flush (void);
/* Return != 0 if serial port is ready to send another char. */
extern unsigned char serial_send_ready (void);
/* Send the character on the serial line. */
extern void serial_send (char c);
/* Wait for a character on the serial line and return it. */
extern unsigned char serial_recv (void);
/** Write the string on the serial line.
@param msg null terminated string to write.
@see serial_init, serial_send
*/
extern void serial_print (const char *msg);
/** Wait for a string from serial line.
@param msg buffer that will hold the string.
@see serial_init, serial_recv
*/
extern void serial_getline (char *buf);
#ifdef mc6811
//# include <asm-m68hc11/sio.h>
#endif
#ifdef mc68hcs12
# include <asm-m68hcs12/sio.h>
#elif defined(mc6812)
//# include <asm-m68hc12/sio.h>
#endif
#ifdef __cplusplus
};
#endif
#endif /* _SYS_SIO_H */