aboutsummaryrefslogtreecommitdiffstats
path: root/xenolinux-2.4.26-sparse/include/asm-xen
diff options
context:
space:
mode:
authoriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>2004-05-02 00:52:45 +0000
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>2004-05-02 00:52:45 +0000
commit3882a78594317ddcaeb97e585080a998ab8a17fe (patch)
tree2d0182dc449cbd96e404e3b94f8964e393fd39f0 /xenolinux-2.4.26-sparse/include/asm-xen
parent685d71bab181325dd4f5a5965314fa647fdf68a6 (diff)
parentf7a3ec9450a8f4aeb43bfa4ad65636325e756a61 (diff)
downloadxen-3882a78594317ddcaeb97e585080a998ab8a17fe.tar.gz
xen-3882a78594317ddcaeb97e585080a998ab8a17fe.tar.bz2
xen-3882a78594317ddcaeb97e585080a998ab8a17fe.zip
bitkeeper revision 1.885 (4094465dmX2TefiJicy4taNzc0jiaw)
manual merge
Diffstat (limited to 'xenolinux-2.4.26-sparse/include/asm-xen')
-rw-r--r--xenolinux-2.4.26-sparse/include/asm-xen/ctrl_if.h2
-rw-r--r--xenolinux-2.4.26-sparse/include/asm-xen/io.h36
-rw-r--r--xenolinux-2.4.26-sparse/include/asm-xen/pgtable-2level.h13
-rw-r--r--xenolinux-2.4.26-sparse/include/asm-xen/proc_cmd.h18
4 files changed, 58 insertions, 11 deletions
diff --git a/xenolinux-2.4.26-sparse/include/asm-xen/ctrl_if.h b/xenolinux-2.4.26-sparse/include/asm-xen/ctrl_if.h
index f1d2b77c2e..a02e2471ea 100644
--- a/xenolinux-2.4.26-sparse/include/asm-xen/ctrl_if.h
+++ b/xenolinux-2.4.26-sparse/include/asm-xen/ctrl_if.h
@@ -52,7 +52,7 @@ int ctrl_if_send_message_noblock(
* function returns.
* 2. If @hnd is NULL then no callback is executed.
*/
-int ctrl_if_send_message(
+int ctrl_if_send_message_block(
ctrl_msg_t *msg,
ctrl_msg_handler_t hnd,
unsigned long id,
diff --git a/xenolinux-2.4.26-sparse/include/asm-xen/io.h b/xenolinux-2.4.26-sparse/include/asm-xen/io.h
index 3d78e20950..f5243bb6a7 100644
--- a/xenolinux-2.4.26-sparse/include/asm-xen/io.h
+++ b/xenolinux-2.4.26-sparse/include/asm-xen/io.h
@@ -159,13 +159,47 @@ extern void iounmap(void *addr);
extern void *bt_ioremap(unsigned long offset, unsigned long size);
extern void bt_iounmap(void *addr, unsigned long size);
+#ifdef CONFIG_XEN_PHYSDEV_ACCESS
+
+#ifdef CONFIG_HIGHMEM
+#error "Highmem is not yet compatible with physical device access"
+#endif
+
/*
- * IO bus memory addresses are also 1:1 with the physical address
+ * The bus translation macros need special care if we are executing device
+ * accesses to/from other domains' memory. In these cases the virtual address
+ * is actually a temporary mapping in the 'vmalloc' space. The physical
+ * address will therefore be >max_low_pfn, and will not have a valid entry
+ * in the phys_to_mach mapping table.
*/
+static inline unsigned long phys_to_bus(unsigned long phys)
+{
+ extern unsigned long max_pfn;
+ pgd_t *pgd; pmd_t *pmd; pte_t *pte;
+ void *addr;
+ unsigned long bus;
+ if ( (phys >> PAGE_SHIFT) < max_pfn )
+ return phys_to_machine(phys);
+ addr = phys_to_virt(phys);
+ pgd = pgd_offset_k( (unsigned long)addr);
+ pmd = pmd_offset(pgd, (unsigned long)addr);
+ pte = pte_offset(pmd, (unsigned long)addr);
+ bus = (pte->pte_low & PAGE_MASK) | (phys & ~PAGE_MASK);
+ return bus;
+}
+
+#define virt_to_bus(_x) phys_to_bus(virt_to_phys(_x))
+#define bus_to_virt(_x) phys_to_virt(machine_to_phys(_x))
+#define page_to_bus(_x) phys_to_bus(page_to_phys(_x))
+
+#else
+
#define virt_to_bus(_x) phys_to_machine(virt_to_phys(_x))
#define bus_to_virt(_x) phys_to_virt(machine_to_phys(_x))
#define page_to_bus(_x) phys_to_machine(page_to_phys(_x))
+#endif /* CONFIG_XEN_PHYSDEV_ACCESS */
+
/*
* readX/writeX() are used to access memory mapped devices. On some
* architectures the memory mapped IO stuff needs to be accessed
diff --git a/xenolinux-2.4.26-sparse/include/asm-xen/pgtable-2level.h b/xenolinux-2.4.26-sparse/include/asm-xen/pgtable-2level.h
index c780f644c0..162ba1fbed 100644
--- a/xenolinux-2.4.26-sparse/include/asm-xen/pgtable-2level.h
+++ b/xenolinux-2.4.26-sparse/include/asm-xen/pgtable-2level.h
@@ -47,6 +47,11 @@ static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
return (pmd_t *) dir;
}
+#define pte_same(a, b) ((a).pte_low == (b).pte_low)
+#define pte_page(x) (mem_map+((unsigned long)((pte_val(x) >> PAGE_SHIFT))))
+#define pte_none(x) (!(x).pte_low)
+#define __mk_pte(page_nr,pgprot) __pte(((page_nr) << PAGE_SHIFT) | pgprot_val(pgprot))
+
/*
* A note on implementation of this atomic 'get-and-clear' operation.
* This is actually very simple because XenoLinux can only run on a single
@@ -59,13 +64,9 @@ static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
static inline pte_t ptep_get_and_clear(pte_t *xp)
{
pte_t pte = *xp;
- queue_l1_entry_update(xp, 0);
+ if ( !pte_none(pte) )
+ queue_l1_entry_update(xp, 0);
return pte;
}
-#define pte_same(a, b) ((a).pte_low == (b).pte_low)
-#define pte_page(x) (mem_map+((unsigned long)((pte_val(x) >> PAGE_SHIFT))))
-#define pte_none(x) (!(x).pte_low)
-#define __mk_pte(page_nr,pgprot) __pte(((page_nr) << PAGE_SHIFT) | pgprot_val(pgprot))
-
#endif /* _I386_PGTABLE_2LEVEL_H */
diff --git a/xenolinux-2.4.26-sparse/include/asm-xen/proc_cmd.h b/xenolinux-2.4.26-sparse/include/asm-xen/proc_cmd.h
index 30cec9aff5..3bf03c6064 100644
--- a/xenolinux-2.4.26-sparse/include/asm-xen/proc_cmd.h
+++ b/xenolinux-2.4.26-sparse/include/asm-xen/proc_cmd.h
@@ -32,10 +32,22 @@ typedef struct privcmd_blkmsg
int buf_size;
} privcmd_blkmsg_t;
-#define IOCTL_PRIVCMD_HYPERCALL \
+/*
+ * @cmd: IOCTL_PRIVCMD_HYPERCALL
+ * @arg: &privcmd_hypercall_t
+ * Return: Value returned from execution of the specified hypercall.
+ */
+#define IOCTL_PRIVCMD_HYPERCALL \
_IOC(_IOC_NONE, 'P', 0, sizeof(privcmd_hypercall_t))
-#define IOCTL_PRIVCMD_BLKMSG \
- _IOC(_IOC_NONE, 'P', 1, sizeof(privcmd_blkmsg_t))
+
+/*
+ * @cmd: IOCTL_PRIVCMD_INITDOMAIN_EVTCHN
+ * @arg: n/a
+ * Return: Port associated with domain-controller end of control event channel
+ * for the initial domain.
+ */
+#define IOCTL_PRIVCMD_INITDOMAIN_EVTCHN \
+ _IOC(_IOC_NONE, 'P', 1, 0)
#define IOCTL_PRIVCMD_MMAP \
_IOC(_IOC_NONE, 'P', 2, sizeof(privcmd_mmap_t))