diff -r c8962b24fb50 xen/arch/x86/setup.c --- a/xen/arch/x86/setup.c Fri Jan 30 11:12:57 2009 +0900 +++ b/xen/arch/x86/setup.c Thu Feb 05 13:58:35 2009 -0700 @@ -109,6 +109,7 @@ extern void early_cpu_init(void); extern void early_cpu_init(void); extern void vesa_init(void); extern void vesa_mtrr_init(void); +extern void init_tmem(void); DEFINE_PER_CPU(struct desc_struct *, gdt_table) = boot_cpu_gdt_table; #ifdef CONFIG_COMPAT @@ -1056,6 +1057,8 @@ void __init __start_xen(unsigned long mb init_trace_bufs(); + init_tmem(); + console_endboot(); /* Hide UART from DOM0 if we're using it */ diff -r c8962b24fb50 xen/arch/x86/x86_32/entry.S --- a/xen/arch/x86/x86_32/entry.S Fri Jan 30 11:12:57 2009 +0900 +++ b/xen/arch/x86/x86_32/entry.S Thu Feb 05 13:58:35 2009 -0700 @@ -703,6 +703,7 @@ ENTRY(hypercall_table) .long do_sysctl /* 35 */ .long do_domctl .long do_kexec_op + .long do_tmem_op .rept __HYPERVISOR_arch_0-((.-hypercall_table)/4) .long do_ni_hypercall .endr @@ -750,6 +751,7 @@ ENTRY(hypercall_args_table) .byte 1 /* do_sysctl */ /* 35 */ .byte 1 /* do_domctl */ .byte 2 /* do_kexec_op */ + .byte 1 /* do_tmem_op */ .rept __HYPERVISOR_arch_0-(.-hypercall_args_table) .byte 0 /* do_ni_hypercall */ .endr diff -r c8962b24fb50 xen/arch/x86/x86_64/compat/entry.S --- a/xen/arch/x86/x86_64/compat/entry.S Fri Jan 30 11:12:57 2009 +0900 +++ b/xen/arch/x86/x86_64/compat/entry.S Thu Feb 05 13:58:35 2009 -0700 @@ -408,6 +408,7 @@ ENTRY(compat_hypercall_table) .quad do_sysctl /* 35 */ .quad do_domctl .quad compat_kexec_op + .quad do_tmem_op .rept __HYPERVISOR_arch_0-((.-compat_hypercall_table)/8) .quad compat_ni_hypercall .endr @@ -455,6 +456,7 @@ ENTRY(compat_hypercall_args_table) .byte 1 /* do_sysctl */ /* 35 */ .byte 1 /* do_domctl */ .byte 2 /* compat_kexec_op */ + .byte 1 /* do_tmem_op */ .rept __HYPERVISOR_arch_0-(.-compat_hypercall_args_table) .byte 0 /* compat_ni_hypercall */ .endr diff -r c8962b24fb50 xen/arch/x86/x86_64/entry.S --- a/xen/arch/x86/x86_64/entry.S Fri Jan 30 11:12:57 2009 +0900 +++ b/xen/arch/x86/x86_64/entry.S Thu Feb 05 13:58:35 2009 -0700 @@ -692,6 +692,7 @@ ENTRY(hypercall_table) .quad do_sysctl /* 35 */ .quad do_domctl .quad do_kexec_op + .quad do_tmem_op .rept __HYPERVISOR_arch_0-((.-hypercall_table)/8) .quad do_ni_hypercall .endr @@ -739,7 +740,7 @@ ENTRY(hypercall_args_table) .byte 1 /* do_sysctl */ /* 35 */ .byte 1 /* do_domctl */ .byte 2 /* do_kexec */ - .byte 1 /* do_xsm_op */ + .byte 1 /* do_tmem_op */ .rept __HYPERVISOR_arch_0-(.-hypercall_args_table) .byte 0 /* do_ni_hypercall */ .endr diff -r c8962b24fb50 xen/common/Makefile --- a/xen/common/Makefile Fri Jan 30 11:12:57 2009 +0900 +++ b/xen/common/Makefile Thu Feb 05 13:58:35 2009 -0700 @@ -28,6 +28,10 @@ obj-y += vsprintf.o obj-y += vsprintf.o obj-y += xmalloc_tlsf.o obj-y += rcupdate.o +obj-y += tmem.o +obj-y += tmem_xen.o +obj-y += radix-tree.o +obj-y += lzo.o obj-$(perfc) += perfc.o obj-$(crash_debug) += gdbstub.o diff -r c8962b24fb50 xen/common/domain.c --- a/xen/common/domain.c Fri Jan 30 11:12:57 2009 +0900 +++ b/xen/common/domain.c Thu Feb 05 13:58:35 2009 -0700 @@ -30,6 +30,7 @@ #include #include #include +#include /* Linux config option: propageted to domain0 */ /* xen_processor_pmbits: xen control Cx, Px, ... */ @@ -569,6 +570,9 @@ static void complete_domain_destroy(stru grant_table_destroy(d); + if ( d->tmem != NULL ) + tmem_destroy(d->tmem); + arch_domain_destroy(d); rangeset_domain_destroy(d); diff -r c8962b24fb50 xen/include/xen/hypercall.h --- a/xen/include/xen/hypercall.h Fri Jan 30 11:12:57 2009 +0900 +++ b/xen/include/xen/hypercall.h Thu Feb 05 13:58:35 2009 -0700 @@ -117,6 +117,10 @@ do_xsm_op( do_xsm_op( XEN_GUEST_HANDLE(xsm_op_t) u_xsm_op); +extern long +do_tmem_op( + XEN_GUEST_HANDLE(tmem_op_t) uops); + #ifdef CONFIG_COMPAT extern int