activated the new workaround...

This commit is contained in:
joxe 2010-03-19 14:50:07 +00:00
parent 7e6919cc8c
commit e99c906caf
2 changed files with 44 additions and 44 deletions

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* @(#)$Id: msp430.c,v 1.11 2010/03/19 14:39:45 joxe Exp $
* @(#)$Id: msp430.c,v 1.12 2010/03/19 14:50:07 joxe Exp $
*/
#include <io.h>
#include <signal.h>
@ -39,28 +39,28 @@
#include "net/uip.h"
/* /\*---------------------------------------------------------------------------*\/ */
/* void * */
/* w_memcpy(void *out, const void *in, size_t n) */
/* { */
/* uint8_t *src, *dest; */
/* src = (uint8_t *) in; */
/* dest = (uint8_t *) out; */
/* while(n-- > 0) { */
/* *dest++ = *src++; */
/* } */
/* return out; */
/* } */
/* /\*---------------------------------------------------------------------------*\/ */
/* void * */
/* w_memset(void *out, int value, size_t n) */
/* { */
/* uint8_t *dest; */
/* dest = (uint8_t *) out; */
/* while(n-- > 0) { */
/* *dest++ = value & 0xff; */
/* } */
/* return out; */
/* } */
void *
w_memcpy(void *out, const void *in, size_t n)
{
uint8_t *src, *dest;
src = (uint8_t *) in;
dest = (uint8_t *) out;
while(n-- > 0) {
*dest++ = *src++;
}
return out;
}
/*---------------------------------------------------------------------------*/
void *
w_memset(void *out, int value, size_t n)
{
uint8_t *dest;
dest = (uint8_t *) out;
while(n-- > 0) {
*dest++ = value & 0xff;
}
return out;
}
/*---------------------------------------------------------------------------*/
void
msp430_init_dco(void)

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)$Id: msp430def.h,v 1.4 2010/03/19 14:39:45 joxe Exp $
* @(#)$Id: msp430def.h,v 1.5 2010/03/19 14:50:07 joxe Exp $
*/
#ifndef MSP430DEF_H
@ -76,29 +76,29 @@ spl_t splhigh_(void);
#ifndef memcpy
#include <string.h>
/* void *w_memcpy(void *out, const void *in, size_t n); */
void *w_memcpy(void *out, const void *in, size_t n);
#define memcpy(dest, src, count) w_memcpy(dest, src, count)
/* #define memcpy(dest, src, count) w_memcpy(dest, src, count) */
#define memcpy(dest, src, count) do { \
if(count == 2) { \
*((uint8_t *)dest) = *((uint8_t *)src); \
*((uint8_t *)dest + 1) = *((uint8_t *)src + 1); \
} else { \
memcpy(dest, src, count); \
} \
} while(0)
/* #define memcpy(dest, src, count) do { \ */
/* if(count == 2) { \ */
/* *((uint8_t *)dest) = *((uint8_t *)src); \ */
/* *((uint8_t *)dest + 1) = *((uint8_t *)src + 1); \ */
/* } else { \ */
/* memcpy(dest, src, count); \ */
/* } \ */
/* } while(0) */
/* void *w_memset(void *out, int value, size_t n); */
void *w_memset(void *out, int value, size_t n);
#define memset(dest, value, count) w_memset(dest, value, count)
/* #define memset(dest, value, count) w_memset(dest, value, count) */
#define memset(dest, value, count) do { \
if(count == 2) { \
*((uint8_t *)dest) = (uint8_t)value; \
*((uint8_t *)dest + 1) = (uint8_t)value; \
} else { \
memset(dest, value, count); \
} \
} while(0)
/* #define memset(dest, value, count) do { \ */
/* if(count == 2) { \ */
/* *((uint8_t *)dest) = (uint8_t)value; \ */
/* *((uint8_t *)dest + 1) = (uint8_t)value; \ */
/* } else { \ */
/* memset(dest, value, count); \ */
/* } \ */
/* } while(0) */
#endif /* memcpy */
#endif /* __GNUC__ && __MSP430__ && MSP430_MEMCPY_WORKAROUND */