diff --git a/arch/arm/src/common/up_arch.h b/arch/arm/src/common/up_arch.h index fc6981efb6f..c5fbc902372 100644 --- a/arch/arm/src/common/up_arch.h +++ b/arch/arm/src/common/up_arch.h @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/common/up_arch.h * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -45,10 +45,6 @@ # include #endif -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Inline Functions ****************************************************************************/ @@ -57,27 +53,11 @@ # define getreg8(a) (*(volatile uint8_t *)(a)) # define putreg8(v,a) (*(volatile uint8_t *)(a) = (v)) +# define getreg16(a) (*(volatile uint16_t *)(a)) +# define putreg16(v,a) (*(volatile uint16_t *)(a) = (v)) # define getreg32(a) (*(volatile uint32_t *)(a)) # define putreg32(v,a) (*(volatile uint32_t *)(a) = (v)) -/* Some compiler options will convert short loads and stores into byte loads - * and stores. We don't want this to happen for IO reads and writes! - */ - -/* # define getreg16(a) (*(volatile uint16_t *)(a)) */ -static inline uint16_t getreg16(unsigned int addr) -{ - uint16_t retval; - __asm__ __volatile__("\tldrh %0, [%1]\n\t" : "=r"(retval) : "r"(addr)); - return retval; -} - -/* define putreg16(v,a) (*(volatile uint16_t *)(a) = (v)) */ -static inline void putreg16(uint16_t val, unsigned int addr) -{ - __asm__ __volatile__("\tstrh %0, [%1]\n\t": : "r"(val), "r"(addr)); -} - /**************************************************************************** * Public Function Prototypes ****************************************************************************/