Remove unneeded /proc/xen/grant and its libxc wrapper.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 25 Jan 2006 23:17:06 +0000 (00:17 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 25 Jan 2006 23:17:06 +0000 (00:17 +0100)
Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c
tools/libxc/Makefile
tools/libxc/xc_gnttab.c [deleted file]
tools/libxc/xenctrl.h

index 632ab1fafd7b7d2c4bd94b76942d9ceaac192f6d..50f6bde4cbaf85a4be986c6a8b6cf32b29bfaa9d 100644 (file)
@@ -14,7 +14,6 @@
 #include <asm-xen/xen-public/xen.h>
 #include <asm/fixmap.h>
 #include <asm/uaccess.h>
-#include <asm-xen/xen_proc.h>
 #include <asm-xen/linux-public/privcmd.h>
 #include <asm-xen/gnttab.h>
 #include <asm/synch_bitops.h>
@@ -340,81 +339,6 @@ gnttab_request_free_callback(struct gnttab_free_callback *callback,
        spin_unlock_irqrestore(&gnttab_list_lock, flags);
 }
 
-/*
- * ProcFS operations
- */
-
-#ifdef CONFIG_PROC_FS
-
-static struct proc_dir_entry *grant_pde;
-static struct file_operations grant_file_ops;
-
-static int
-grant_read(char *page, char **start, off_t off, int count, int *eof,
-          void *data)
-{
-       int             len;
-       unsigned int    i;
-       grant_entry_t  *gt;
-
-       gt = (grant_entry_t *)shared;
-       len = 0;
-
-       for (i = 0; i < NR_GRANT_ENTRIES; i++) {
-               if (len > (PAGE_SIZE - 200)) {
-                       len += sprintf( page + len, "Truncated.\n");
-                       break;
-               }
-       }
-
-       if (gt[i].flags) {
-               len += sprintf(page + len,
-                              "Grant: ref (0x%x) flags (0x%hx) "
-                              "dom (0x%hx) frame (0x%x)\n", 
-                              i,
-                              gt[i].flags,
-                              gt[i].domid,
-                              gt[i].frame );
-       }
-
-       *eof = 1;
-       return len;
-}
-
-static int
-grant_write(struct file *file, const char __user *buffer, unsigned long count,
-           void *data)
-{
-       /* TODO: implement this */
-       return -ENOSYS;
-}
-
-static int __init
-gnttab_proc_init(void)
-{
-       /*
-        *  /proc/xen/grant : used by libxc to access grant tables
-        */
-       if ((grant_pde = create_xen_proc_entry("grant", 0600)) == NULL) {
-               WPRINTK("Unable to create grant xen proc entry\n");
-               return -1;
-       }
-
-       grant_file_ops.read   = grant_pde->proc_fops->read;
-       grant_file_ops.write  = grant_pde->proc_fops->write;
-
-       grant_pde->proc_fops  = &grant_file_ops;
-
-       grant_pde->read_proc  = &grant_read;
-       grant_pde->write_proc = &grant_write;
-
-       return 0;
-}
-
-device_initcall(gnttab_proc_init);
-
-#endif /* CONFIG_PROC_FS */
-
 int
 gnttab_resume(void)
 {
index d4ad7d34e0b22675018ee78c1626e23e4bc7a1e2..44fc9d8160f7a248a6fdb3a6a75709b17dcb2b04 100644 (file)
@@ -17,7 +17,6 @@ SRCS       += xc_bvtsched.c
 SRCS       += xc_core.c
 SRCS       += xc_domain.c
 SRCS       += xc_evtchn.c
-SRCS       += xc_gnttab.c
 SRCS       += xc_misc.c
 SRCS       += xc_physdev.c
 SRCS       += xc_private.c
diff --git a/tools/libxc/xc_gnttab.c b/tools/libxc/xc_gnttab.c
deleted file mode 100644 (file)
index 76b7b14..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/******************************************************************************
- * xc_gnttab.c
- * 
- * API for manipulating and accessing grant tables
- * 
- * Copyright (c) 2005 Christopher Clark
- * based on xc_evtchn.c Copyright (c) 2004, K A Fraser.
- */
-
-#include "xc_private.h"
-#include "xen/grant_table.h"
-
-static int
-do_gnttab_op(int xc_handle,
-             unsigned long cmd,
-             void *op,
-             unsigned long count)
-{
-    int ret = -1;
-    DECLARE_HYPERCALL;
-
-    hypercall.op     = __HYPERVISOR_grant_table_op;
-    hypercall.arg[0] = cmd;
-    hypercall.arg[1] = (unsigned long)op;
-    hypercall.arg[2] = count;
-
-    if ( mlock(op, 64) )
-    {
-        PERROR("do_gnttab_op: op mlock failed");
-        goto out;
-    }
-
-    if ( (ret = do_xen_hypercall(xc_handle, &hypercall)) < 0 )
-        ERROR("do_gnttab_op: HYPERVISOR_grant_table_op failed: %d", ret);
-
-    safe_munlock(op, 64);
- out:
-    return ret;
-}
-
-
-int xc_gnttab_map_grant_ref(int         xc_handle,
-                            uint64_t    host_virt_addr,
-                            uint32_t    dom,
-                            grant_ref_t ref,
-                            uint16_t    flags,
-                            int16_t    *status,
-                            grant_handle_t *handle,
-                            uint64_t   *dev_bus_addr)
-{
-    struct gnttab_map_grant_ref op;
-    int rc;
-
-    op.host_addr      = host_virt_addr;
-    op.dom            = (domid_t)dom;
-    op.ref            = ref;
-    op.flags          = flags;
-    if ( (rc = do_gnttab_op(xc_handle, GNTTABOP_map_grant_ref,
-                            &op, 1)) == 0 )
-    {
-        *status         = op.status;
-        *handle         = op.handle;
-        *dev_bus_addr   = op.dev_bus_addr;
-    }
-
-    return rc;
-}
-
-
-int xc_gnttab_unmap_grant_ref(int       xc_handle,
-                              uint64_t  host_virt_addr,
-                              uint64_t  dev_bus_addr,
-                              grant_handle_t handle,
-                              int16_t  *status)
-{
-    struct gnttab_unmap_grant_ref op;
-    int rc;
-
-    op.host_addr      = host_virt_addr;
-    op.dev_bus_addr   = dev_bus_addr;
-    op.handle         = handle;
-    if ( (rc = do_gnttab_op(xc_handle, GNTTABOP_unmap_grant_ref,
-                            &op, 1)) == 0 )
-    {
-        *status = op.status;
-    }
-
-    return rc;
-}
-
-int xc_gnttab_setup_table(int        xc_handle,
-                          uint32_t   dom,
-                          uint16_t   nr_frames,
-                          int16_t   *status,
-                          unsigned long **frame_list)
-{
-    struct gnttab_setup_table op;
-    int rc, i;
-
-    op.dom       = (domid_t)dom;
-    op.nr_frames = nr_frames;
-    if ( (rc = do_gnttab_op(xc_handle, GNTTABOP_setup_table, &op, 1)) == 0 )
-    {
-        *status = op.status;
-        for ( i = 0; i < nr_frames; i++ )
-            (*frame_list)[i] = op.frame_list[i];
-    }
-
-    return rc;
-}
-
-int xc_gnttab_dump_table(int        xc_handle,
-                         uint32_t   dom,
-                         int16_t   *status)
-{
-    struct gnttab_dump_table op;
-    int rc;
-
-    op.dom = (domid_t)dom;
-
-    if ( (rc = do_gnttab_op(xc_handle, GNTTABOP_dump_table, &op, 1)) == 0 )
-        *status = op.status;
-
-    return rc;
-}
-
-int xc_grant_interface_open(void)
-{
-    int fd = open("/proc/xen/grant", O_RDWR);
-    if ( fd == -1 )
-        PERROR("Could not obtain handle on grant command interface");
-    return fd;
-
-}
-
-int xc_grant_interface_close(int xc_grant_handle)
-{
-    return close(xc_grant_handle);
-}
index 2adf825cd4cf8a3d384c39e89ba17bc5d0e93e7d..91d717c55c7ea20cc8fe9303458329f5496f2ace 100644 (file)
@@ -13,7 +13,6 @@
 #include <sys/ptrace.h>
 #include <xen/xen.h>
 #include <xen/dom0_ops.h>
-#include <xen/grant_table.h>
 #include <xen/version.h>
 #include <xen/event_channel.h>
 #include <xen/sched.h>
@@ -467,63 +466,6 @@ int xc_get_pfn_type_batch(int xc_handle, uint32_t dom,
                           int num, unsigned long *arr);
 
 
-/*\
- *  GRANT TABLE FUNCTIONS
-\*/ 
-
-/**
- * This function opens a handle to the more restricted grant table hypervisor
- * interface. This may be used where the standard interface is not
- * available because the domain is not privileged.
- * This function can  be called multiple times within a single process.
- * Multiple processes can have an open hypervisor interface at the same time.
- *
- * Each call to this function should have a corresponding call to
- * xc_grant_interface_close().
- *
- * This function can fail if a Xen-enabled kernel is not currently running.
- *
- * @return a handle to the hypervisor grant table interface or -1 on failure
- */
-int xc_grant_interface_open(void);
-
-/**
- * This function closes an open grant table hypervisor interface.
- *
- * This function can fail if the handle does not represent an open interface or
- * if there were problems closing the interface.
- *
- * @parm xc_handle a handle to an open grant table hypervisor interface
- * @return 0 on success, -1 otherwise.
- */
-int xc_grant_interface_close(int xc_handle);
-
-int xc_gnttab_map_grant_ref(int      xc_handle,
-                            uint64_t host_virt_addr,
-                            uint32_t dom,
-                            grant_ref_t ref,
-                            uint16_t flags,
-                            int16_t *status,
-                            grant_handle_t *handle,
-                            uint64_t *dev_bus_addr);
-
-int xc_gnttab_unmap_grant_ref(int  xc_handle,
-                              uint64_t  host_virt_addr,
-                              uint64_t  dev_bus_addr,
-                              grant_handle_t handle,
-                              int16_t *status);
-
-int xc_gnttab_setup_table(int        xc_handle,
-                          uint32_t   dom,
-                          uint16_t   nr_frames,
-                          int16_t   *status,
-                          unsigned long **frame_list);
-
-/* Grant debug builds only: */
-int xc_gnttab_dump_table(int        xc_handle,
-                         uint32_t   dom,
-                         int16_t   *status);
-
 /* Get current total pages allocated to a domain. */
 long xc_get_tot_pages(int xc_handle, uint32_t domid);