source: grub-pc/trunk/fuentes/grub-core/kern/powerpc/cache_flush.S @ 22

Last change on this file since 22 was 22, checked in by mabarracus, 4 years ago

updated version and apply net.ifnames=0 into debian/rules

File size: 1.4 KB
Line 
1/* cache.S - Flush the processor cache for a specific region.  */
2/*
3 *  GRUB  --  GRand Unified Bootloader
4 *  Copyright (C) 2004,2007,2010  Free Software Foundation, Inc.
5 *
6 *  GRUB is free software: you can redistribute it and/or modify
7 *  it under the terms of the GNU General Public License as published by
8 *  the Free Software Foundation, either version 3 of the License, or
9 *  (at your option) any later version.
10 *
11 *  GRUB is distributed in the hope that it will be useful,
12 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 *  GNU General Public License for more details.
15 *
16 *  You should have received a copy of the GNU General Public License
17 *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#undef CACHE_LINE_BYTES
21#define CACHE_LINE_BYTES 32
22
23        /* `address' may not be CACHE_LINE_BYTES-aligned.  */
24        andi. 6, 3, CACHE_LINE_BYTES - 1 /* Find the misalignment.  */
25        add 4, 4, 6 /* Adjust `size' to compensate.  */
26
27        /* Force the dcache lines to memory.  */
28        li 5, 0
291:      dcbst 5, 3
30        addi 5, 5, CACHE_LINE_BYTES
31        cmpw 5, 4
32        blt 1b
33        sync            /* Force all dcbsts to complete.  */
34
35        /* Invalidate the icache lines.  */
36        li 5, 0
371:      icbi 5, 3
38        addi 5, 5, CACHE_LINE_BYTES
39        cmpw 5, 4
40        blt 1b
41        sync            /* Force all icbis to complete.  */
42        isync           /* Discard partially executed instructions that were
43                           loaded from the invalid icache.  */
Note: See TracBrowser for help on using the repository browser.