1
/* MN10300 CPU core caching macros -*- asm -*-
3
* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4
* Written by David Howells (dhowells@redhat.com)
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public Licence
8
* as published by the Free Software Foundation; either version
9
* 2 of the Licence, or (at your option) any later version.
13
###############################################################################
15
# Invalidate the instruction cache.
16
# A0: Should hold CHCTR
17
# D0: Should have been read from CHCTR
18
# D1: Will be clobbered
20
# On some cores it is necessary to disable the icache whilst we do this.
22
###############################################################################
23
.macro invalidate_icache,disable_irq
25
#if defined(CONFIG_AM33_2) || defined(CONFIG_AM33_3)
27
# don't want an interrupt routine seeing a disabled cache
39
# and wait for it to calm down
49
# wait for the cache to finish
64
#else /* CONFIG_AM33_2 || CONFIG_AM33_3 */
71
#endif /* CONFIG_AM33_2 || CONFIG_AM33_3 */
74
###############################################################################
76
# Invalidate the data cache.
77
# A0: Should hold CHCTR
78
# D0: Should have been read from CHCTR
79
# D1: Will be clobbered
81
# On some cores it is necessary to disable the dcache whilst we do this.
83
###############################################################################
84
.macro invalidate_dcache,disable_irq
86
#if defined(CONFIG_AM33_2) || defined(CONFIG_AM33_3)
88
# don't want an interrupt routine seeing a disabled cache
100
# and wait for it to calm down
110
# wait for the cache to finish
122
LOCAL_IRQ_RESTORE(d1)
125
#else /* CONFIG_AM33_2 || CONFIG_AM33_3 */
132
#endif /* CONFIG_AM33_2 || CONFIG_AM33_3 */