From 6da84819dd8798e1c4e252233390a7f31864bafe Mon Sep 17 00:00:00 2001 From: maralvira Date: Wed, 10 Nov 2010 22:06:28 +0000 Subject: [PATCH] use stdint.h instead of custom types.h stdint.h is more portable across compilers --- cpu/mc1322x/lib/gpio.c | 4 +-- cpu/mc1322x/lib/include/crm.h | 4 +-- cpu/mc1322x/lib/include/isr.h | 4 ++- cpu/mc1322x/lib/include/maca.h | 4 +-- cpu/mc1322x/lib/include/mc1322x.h | 3 +- cpu/mc1322x/lib/include/nvm.h | 4 +-- cpu/mc1322x/lib/include/types.h | 48 ------------------------------ cpu/mc1322x/lib/include/uart1.h | 4 +-- cpu/mc1322x/lib/uart1.c | 4 +-- cpu/mc1322x/src/default_lowlevel.c | 4 +-- cpu/mc1322x/src/isr.c | 4 +-- 11 files changed, 20 insertions(+), 67 deletions(-) delete mode 100644 cpu/mc1322x/lib/include/types.h diff --git a/cpu/mc1322x/lib/gpio.c b/cpu/mc1322x/lib/gpio.c index 4e2eb51b6..1d2700194 100644 --- a/cpu/mc1322x/lib/gpio.c +++ b/cpu/mc1322x/lib/gpio.c @@ -30,11 +30,11 @@ * This file is part of libmc1322x: see http://mc1322x.devl.org * for details. * - * $Id: gpio.c,v 1.1 2010/06/10 14:55:39 maralvira Exp $ + * $Id: gpio.c,v 1.2 2010/11/10 22:06:28 maralvira Exp $ */ #include -#include +#include inline void gpio_pad_dir(volatile uint64_t data) { diff --git a/cpu/mc1322x/lib/include/crm.h b/cpu/mc1322x/lib/include/crm.h index abf4e201a..58087cea4 100644 --- a/cpu/mc1322x/lib/include/crm.h +++ b/cpu/mc1322x/lib/include/crm.h @@ -30,13 +30,13 @@ * This file is part of libmc1322x: see http://mc1322x.devl.org * for details. * - * $Id: crm.h,v 1.5 2010/11/07 14:42:31 maralvira Exp $ + * $Id: crm.h,v 1.6 2010/11/10 22:06:28 maralvira Exp $ */ #ifndef CRM_H #define CRM_H -#include +#include #define CRM_BASE (0x80003000) diff --git a/cpu/mc1322x/lib/include/isr.h b/cpu/mc1322x/lib/include/isr.h index 964228388..e33e58c7d 100644 --- a/cpu/mc1322x/lib/include/isr.h +++ b/cpu/mc1322x/lib/include/isr.h @@ -30,7 +30,7 @@ * This file is part of libmc1322x: see http://mc1322x.devl.org * for details. * - * $Id: isr.h,v 1.5 2010/11/07 14:26:24 maralvira Exp $ + * $Id: isr.h,v 1.6 2010/11/10 22:06:28 maralvira Exp $ */ #ifndef ISR_H @@ -38,6 +38,8 @@ #define INTBASE (0x80020000) +#include + /* Structure-based ITC access */ #define __INTERRUPT_union(x) \ union { \ diff --git a/cpu/mc1322x/lib/include/maca.h b/cpu/mc1322x/lib/include/maca.h index 3cfd1ea7d..516b22a00 100644 --- a/cpu/mc1322x/lib/include/maca.h +++ b/cpu/mc1322x/lib/include/maca.h @@ -30,14 +30,14 @@ * This file is part of libmc1322x: see http://mc1322x.devl.org * for details. * - * $Id: maca.h,v 1.2 2010/11/07 14:06:57 maralvira Exp $ + * $Id: maca.h,v 1.3 2010/11/10 22:06:28 maralvira Exp $ */ #ifndef _MACA_H_ #define _MACA_H_ #include -#include +#include #include /* maca initialization and on off routines */ diff --git a/cpu/mc1322x/lib/include/mc1322x.h b/cpu/mc1322x/lib/include/mc1322x.h index 2ff34ef75..fedc173b2 100644 --- a/cpu/mc1322x/lib/include/mc1322x.h +++ b/cpu/mc1322x/lib/include/mc1322x.h @@ -30,13 +30,12 @@ * This file is part of libmc1322x: see http://mc1322x.devl.org * for details. * - * $Id: mc1322x.h,v 1.1 2010/06/10 14:55:39 maralvira Exp $ + * $Id: mc1322x.h,v 1.2 2010/11/10 22:06:28 maralvira Exp $ */ #ifndef MC1322X_H #define MC1322X_H -#include "types.h" #include "isr.h" #include "gpio.h" #include "crm.h" diff --git a/cpu/mc1322x/lib/include/nvm.h b/cpu/mc1322x/lib/include/nvm.h index d9b81065c..a7ad6245e 100644 --- a/cpu/mc1322x/lib/include/nvm.h +++ b/cpu/mc1322x/lib/include/nvm.h @@ -30,13 +30,13 @@ * This file is part of libmc1322x: see http://mc1322x.devl.org * for details. * - * $Id: nvm.h,v 1.1 2010/06/10 14:55:39 maralvira Exp $ + * $Id: nvm.h,v 1.2 2010/11/10 22:06:28 maralvira Exp $ */ #ifndef NVM_H #define NVM_H -#include "types.h" +#include "stdint.h" typedef enum { diff --git a/cpu/mc1322x/lib/include/types.h b/cpu/mc1322x/lib/include/types.h deleted file mode 100644 index 2e47389d2..000000000 --- a/cpu/mc1322x/lib/include/types.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2010, Mariano Alvira and other contributors - * to the MC1322x project (http://mc1322x.devl.org) - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * 3. Neither the name of the Institute 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 INSTITUTE 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 INSTITUTE 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. - * - * This file is part of libmc1322x: see http://mc1322x.devl.org - * for details. - * - * $Id: types.h,v 1.1 2010/06/10 14:55:39 maralvira Exp $ - */ - -#ifndef _TYPES_H -#define _TYPES_H - -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef signed long long int int64_t; -typedef unsigned long long int uint64_t; - -#endif diff --git a/cpu/mc1322x/lib/include/uart1.h b/cpu/mc1322x/lib/include/uart1.h index 18ad3bbb5..f70311739 100644 --- a/cpu/mc1322x/lib/include/uart1.h +++ b/cpu/mc1322x/lib/include/uart1.h @@ -30,13 +30,13 @@ * This file is part of libmc1322x: see http://mc1322x.devl.org * for details. * - * $Id: uart1.h,v 1.1 2010/06/10 14:55:39 maralvira Exp $ + * $Id: uart1.h,v 1.2 2010/11/10 22:06:28 maralvira Exp $ */ #ifndef UART1_H #define UART1_H -#include +#include #define UCON (0) /* UCON bits */ diff --git a/cpu/mc1322x/lib/uart1.c b/cpu/mc1322x/lib/uart1.c index 31b772dd2..e58cc40cc 100644 --- a/cpu/mc1322x/lib/uart1.c +++ b/cpu/mc1322x/lib/uart1.c @@ -30,11 +30,11 @@ * This file is part of libmc1322x: see http://mc1322x.devl.org * for details. * - * $Id: uart1.c,v 1.2 2010/07/06 13:39:34 maralvira Exp $ + * $Id: uart1.c,v 1.3 2010/11/10 22:06:28 maralvira Exp $ */ #include -#include +#include volatile char u1_tx_buf[1024]; volatile uint32_t u1_head, u1_tail; diff --git a/cpu/mc1322x/src/default_lowlevel.c b/cpu/mc1322x/src/default_lowlevel.c index 4814f5e58..d50f30f41 100644 --- a/cpu/mc1322x/src/default_lowlevel.c +++ b/cpu/mc1322x/src/default_lowlevel.c @@ -30,11 +30,11 @@ * This file is part of libmc1322x: see http://mc1322x.devl.org * for details. * - * $Id: default_lowlevel.c,v 1.1 2010/06/10 14:49:31 maralvira Exp $ + * $Id: default_lowlevel.c,v 1.2 2010/11/10 22:09:23 maralvira Exp $ */ #include -#include +#include void default_vreg_init(void) { volatile uint32_t i; diff --git a/cpu/mc1322x/src/isr.c b/cpu/mc1322x/src/isr.c index 485b2b707..709ee202a 100644 --- a/cpu/mc1322x/src/isr.c +++ b/cpu/mc1322x/src/isr.c @@ -30,11 +30,11 @@ * This file is part of libmc1322x: see http://mc1322x.devl.org * for details. * - * $Id: isr.c,v 1.4 2010/11/07 14:27:01 maralvira Exp $ + * $Id: isr.c,v 1.5 2010/11/10 22:09:23 maralvira Exp $ */ #include -#include +#include static void (*tmr_isr_funcs[4])(void) = { tmr0_isr,