ia64/xen-unstable

changeset 15908:a79d2c043643

[XEN] add typed p2m entry-setting function
keeping the old one as a fallback for RAM mappings.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
author Tim Deegan <Tim.Deegan@xensource.com>
date Fri Sep 14 09:52:47 2007 +0100 (2007-09-14)
parents ca495837a722
children b032af6ad976
files xen/arch/x86/mm/p2m.c xen/include/asm-x86/p2m.h
line diff
     1.1 --- a/xen/arch/x86/mm/p2m.c	Wed Sep 12 15:42:39 2007 +0100
     1.2 +++ b/xen/arch/x86/mm/p2m.c	Fri Sep 14 09:52:47 2007 +0100
     1.3 @@ -679,8 +679,8 @@ guest_physmap_remove_page(struct domain 
     1.4  }
     1.5  
     1.6  void
     1.7 -guest_physmap_add_page(struct domain *d, unsigned long gfn,
     1.8 -                       unsigned long mfn)
     1.9 +guest_physmap_add_entry(struct domain *d, unsigned long gfn,
    1.10 +                        unsigned long mfn, p2m_type_t t)
    1.11  {
    1.12      unsigned long ogfn;
    1.13      p2m_type_t ot;
    1.14 @@ -727,8 +727,7 @@ guest_physmap_add_page(struct domain *d,
    1.15  
    1.16      if ( mfn_valid(_mfn(mfn)) ) 
    1.17      {
    1.18 -        set_p2m_entry(d, gfn, _mfn(mfn),
    1.19 -                  p2m_type_to_flags(p2m_ram_rw)|__PAGE_HYPERVISOR|_PAGE_USER);
    1.20 +        set_p2m_entry(d, gfn, _mfn(mfn), p2m_type_to_flags(t));
    1.21          set_gpfn_from_mfn(mfn, gfn);
    1.22      }
    1.23      else
     2.1 --- a/xen/include/asm-x86/p2m.h	Wed Sep 12 15:42:39 2007 +0100
     2.2 +++ b/xen/include/asm-x86/p2m.h	Fri Sep 14 09:52:47 2007 +0100
     2.3 @@ -201,8 +201,15 @@ int p2m_alloc_table(struct domain *d,
     2.4  void p2m_teardown(struct domain *d);
     2.5  
     2.6  /* Add a page to a domain's p2m table */
     2.7 -void guest_physmap_add_page(struct domain *d, unsigned long gfn,
     2.8 -                            unsigned long mfn);
     2.9 +void guest_physmap_add_entry(struct domain *d, unsigned long gfn,
    2.10 +                             unsigned long mfn, p2m_type_t t);
    2.11 +
    2.12 +/* Untyped version for RAM only, for compatibility */
    2.13 +static inline void guest_physmap_add_page(struct domain *d, unsigned long gfn,
    2.14 +                                          unsigned long mfn)
    2.15 +{
    2.16 +    guest_physmap_add_entry(d, gfn, mfn, p2m_ram_rw);
    2.17 +}
    2.18  
    2.19  /* Remove a page from a domain's p2m table */
    2.20  void guest_physmap_remove_page(struct domain *d, unsigned long gfn,