ia64/xen-unstable

changeset 12930:1c996041fcde

[XEN][POWERPC] Add Function to completely flush the I-Cache for a processor
Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Jimi Xenidis <jimix@watson.ibm.com>
date Mon Oct 02 11:07:54 2006 -0400 (2006-10-02)
parents 24fd59787982
children 7b6f0a4d5cdd
files xen/arch/powerpc/powerpc64/ppc970.c xen/include/asm-powerpc/cache.h
line diff
     1.1 --- a/xen/arch/powerpc/powerpc64/ppc970.c	Mon Oct 02 11:06:10 2006 -0400
     1.2 +++ b/xen/arch/powerpc/powerpc64/ppc970.c	Mon Oct 02 11:07:54 2006 -0400
     1.3 @@ -39,11 +39,38 @@ struct cpu_caches cpu_caches = {
     1.4      .dline_size = 0x80,
     1.5      .log_dline_size = 7,
     1.6      .dlines_per_page = PAGE_SIZE >> 7,
     1.7 +    .isize = (64 << 10),        /* 64 KiB */
     1.8      .iline_size = 0x80,
     1.9      .log_iline_size = 7,
    1.10      .ilines_per_page = PAGE_SIZE >> 7,
    1.11  };
    1.12  
    1.13 +
    1.14 +void cpu_flush_icache(void)
    1.15 +{
    1.16 +    union hid1 hid1;
    1.17 +    ulong flags;
    1.18 +    ulong ra;
    1.19 +
    1.20 +    local_irq_save(flags);
    1.21 +
    1.22 +    /* uses special processor mode that forces a real address match */
    1.23 +    hid1.word = mfhid1();
    1.24 +    hid1.bits.en_icbi = 1;
    1.25 +    mthid1(hid1.word);
    1.26 +
    1.27 +    for (ra = 0; ra < cpu_caches.isize; ra += cpu_caches.iline_size)
    1.28 +        icbi(ra);
    1.29 +
    1.30 +    sync();
    1.31 +
    1.32 +    hid1.bits.en_icbi = 0;
    1.33 +    mthid1(hid1.word);
    1.34 +
    1.35 +    local_irq_save(flags);
    1.36 +}
    1.37 +
    1.38 +
    1.39  struct rma_settings {
    1.40      int log;
    1.41      int rmlr_0;
     2.1 --- a/xen/include/asm-powerpc/cache.h	Mon Oct 02 11:06:10 2006 -0400
     2.2 +++ b/xen/include/asm-powerpc/cache.h	Mon Oct 02 11:07:54 2006 -0400
     2.3 @@ -70,4 +70,5 @@ struct cpu_caches {
     2.4      u32 ilines_per_page;
     2.5  };
     2.6  extern struct cpu_caches cpu_caches;
     2.7 +extern void cpu_flush_icache(void);
     2.8  #endif