Mercurial > ecos
changeset 482:3bdcf83ee58f
Define data cache sync.
| author | gthomas |
|---|---|
| date | Sat, 04 Jan 2003 03:39:59 +0000 |
| parents | a8431517bdd1 |
| children | 64e0d6240540 |
| files | packages/hal/powerpc/ppc60x/current/ChangeLog packages/hal/powerpc/ppc60x/current/include/var_cache.h |
| diffstat | 2 files changed, 14 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/packages/hal/powerpc/ppc60x/current/ChangeLog +++ b/packages/hal/powerpc/ppc60x/current/ChangeLog @@ -1,3 +1,8 @@ +2003-01-02 Gary Thomas <gary@mlbassoc.com> + + * include/var_cache.h: Define HAL_DCACHE_SYNC() - which had been + left out before! + 2002-08-01 Gary Thomas <gary@mlbassoc.com> * src/var_misc.c (cyg_hal_map_memory): Need to set protection bits.
--- a/packages/hal/powerpc/ppc60x/current/include/var_cache.h +++ b/packages/hal/powerpc/ppc60x/current/include/var_cache.h @@ -11,7 +11,7 @@ // ------------------------------------------- // This file is part of eCos, the Embedded Configurable Operating System. // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. -// Copyright (C) 2002 Gary Thomas +// Copyright (C) 2002, 2003 Gary Thomas // // eCos 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 @@ -133,7 +133,14 @@ CYG_MACRO_END // Synchronize the contents of the cache with memory. -#define HAL_DCACHE_SYNC() +#define HAL_DCACHE_SYNC() \ + CYG_MACRO_START \ + cyg_int32 i; \ + cyg_uint32 *__base = (cyg_uint32 *) (0); \ + for (i = 0; i < (HAL_DCACHE_SIZE/HAL_DCACHE_LINE_SIZE); i++, __base += HAL_DCACHE_LINE_SIZE/4){ \ + asm volatile ("lwz %%r0,0(%0)" : : "r" (__base) : "r0"); \ + } \ + CYG_MACRO_END // Query the state of the data cache #define HAL_DCACHE_IS_ENABLED(_state_) \
