[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [TOOLS] Remove plan9 loader code. Latest plan9 port uses linux builder.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxxxx
# Node ID 1a52829fd60ed55357edbd08b12b99fddc644a57
# Parent  30a5eb240a20026ad99bd371dba6ae4051dfe06b
[TOOLS] Remove plan9 loader code. Latest plan9 port uses linux builder.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 tools/libxc/xc_aout9.h       |   30 -------
 tools/libxc/xc_load_aout9.c  |  178 -------------------------------------------
 tools/libxc/Makefile         |    1 
 tools/libxc/xc_ia64_stubs.c  |   11 --
 tools/libxc/xc_linux_build.c |    8 -
 tools/libxc/xg_private.h     |    7 -
 6 files changed, 3 insertions(+), 232 deletions(-)

diff -r 30a5eb240a20 -r 1a52829fd60e tools/libxc/Makefile
--- a/tools/libxc/Makefile      Tue Jun 27 14:34:52 2006 +0100
+++ b/tools/libxc/Makefile      Tue Jun 27 14:38:58 2006 +0100
@@ -31,7 +31,6 @@ GUEST_SRCS-y += xc_load_elf.c
 GUEST_SRCS-y += xc_load_elf.c
 GUEST_SRCS-y += xg_private.c
 GUEST_SRCS-$(CONFIG_IA64) += xc_ia64_stubs.c
-GUEST_SRCS-$(CONFIG_PLAN9) += xc_load_aout9.c
 GUEST_SRCS-$(CONFIG_MIGRATE) += xc_linux_restore.c xc_linux_save.c
 GUEST_SRCS-$(CONFIG_HVM) += xc_hvm_build.c
 
diff -r 30a5eb240a20 -r 1a52829fd60e tools/libxc/xc_ia64_stubs.c
--- a/tools/libxc/xc_ia64_stubs.c       Tue Jun 27 14:34:52 2006 +0100
+++ b/tools/libxc/xc_ia64_stubs.c       Tue Jun 27 14:38:58 2006 +0100
@@ -38,23 +38,12 @@ int xc_linux_restore(int xc_handle, int 
     return -1;
 }
 
-int
-xc_plan9_build(int xc_handle,
-               uint32_t domid,
-               const char *image_name,
-               const char *cmdline,
-               unsigned int control_evtchn, unsigned long flags)
-{
-    PERROR("xc_plan9_build not implemented\n");
-    return -1;
-}
 /*  
     VMM uses put_user to copy pfn_list to guest buffer, this maybe fail,
     VMM doesn't handle this now.
     This method will touch guest buffer to make sure the buffer's mapping
     is tracked by VMM,
  */
-
 int xc_ia64_get_pfn_list(int xc_handle,
                          uint32_t domid,
                          xen_pfn_t *pfn_buf,
diff -r 30a5eb240a20 -r 1a52829fd60e tools/libxc/xc_linux_build.c
--- a/tools/libxc/xc_linux_build.c      Tue Jun 27 14:34:52 2006 +0100
+++ b/tools/libxc/xc_linux_build.c      Tue Jun 27 14:38:58 2006 +0100
@@ -7,7 +7,6 @@
 #include <xenctrl.h>
 
 #include "xc_elf.h"
-#include "xc_aout9.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <inttypes.h>
@@ -34,10 +33,6 @@
 
 #define round_pgup(_p)    (((_p)+(PAGE_SIZE-1))&PAGE_MASK)
 #define round_pgdown(_p)  ((_p)&PAGE_MASK)
-
-#ifdef __ia64__
-#define probe_aout9(image,image_size,load_funcs) 1
-#endif
 
 struct initrd_info {
     enum { INITRD_none, INITRD_file, INITRD_mem } type;
@@ -124,8 +119,7 @@ static int probeimageformat(const char *
                             struct load_funcs *load_funcs)
 {
     if ( probe_elf(image, image_size, load_funcs) &&
-         probe_bin(image, image_size, load_funcs) &&
-         probe_aout9(image, image_size, load_funcs) )
+         probe_bin(image, image_size, load_funcs) )
     {
         ERROR( "Unrecognized image format" );
         return -EINVAL;
diff -r 30a5eb240a20 -r 1a52829fd60e tools/libxc/xg_private.h
--- a/tools/libxc/xg_private.h  Tue Jun 27 14:34:52 2006 +0100
+++ b/tools/libxc/xg_private.h  Tue Jun 27 14:38:58 2006 +0100
@@ -196,8 +196,5 @@ int probe_elf(const char *image, unsigne
               struct load_funcs *funcs);
 int probe_bin(const char *image, unsigned long image_size,
               struct load_funcs *funcs);
-int probe_aout9(const char *image, unsigned long image_size,
-                struct load_funcs *funcs);
-
-#endif
-
+
+#endif /* XG_PRIVATE_H */
diff -r 30a5eb240a20 -r 1a52829fd60e tools/libxc/xc_aout9.h
--- a/tools/libxc/xc_aout9.h    Tue Jun 27 14:34:52 2006 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-
-typedef struct Exec
-{
-       long    magic;          /* magic number */
-       long    text;           /* size of text segment */
-       long    data;           /* size of initialized data */
-       long    bss;            /* size of uninitialized data */
-       long    syms;           /* size of symbol table */
-       long    entry;          /* entry point */
-       long    spsz;           /* size of pc/sp offset table */
-       long    pcsz;           /* size of pc/line number table */
-} Exec;
-
-#define        _MAGIC(b)       ((((4*b)+0)*b)+7)
-#define        A_MAGIC         _MAGIC(8)       /* 68020 */
-#define        I_MAGIC         _MAGIC(11)      /* intel 386 */
-#define        J_MAGIC         _MAGIC(12)      /* intel 960 (retired) */
-#define        K_MAGIC         _MAGIC(13)      /* sparc */
-#define        V_MAGIC         _MAGIC(16)      /* mips 3000 BE */
-#define        X_MAGIC         _MAGIC(17)      /* att dsp 3210 (retired) */
-#define        M_MAGIC         _MAGIC(18)      /* mips 4000 BE */
-#define        D_MAGIC         _MAGIC(19)      /* amd 29000 (retired) */
-#define        E_MAGIC         _MAGIC(20)      /* arm */
-#define        Q_MAGIC         _MAGIC(21)      /* powerpc */
-#define        N_MAGIC         _MAGIC(22)      /* mips 4000 LE */
-#define        L_MAGIC         _MAGIC(23)      /* dec alpha */
-#define        P_MAGIC         _MAGIC(24)      /* mips 3000 LE */
-#define        U_MAGIC         _MAGIC(25)      /* sparc64 */
-#define        S_MAGIC         _MAGIC(26)      /* amd64 */
-
diff -r 30a5eb240a20 -r 1a52829fd60e tools/libxc/xc_load_aout9.c
--- a/tools/libxc/xc_load_aout9.c       Tue Jun 27 14:34:52 2006 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +0,0 @@
-
-#include "xg_private.h"
-#include "xc_aout9.h"
-
-#if defined(__i386__)
-  #define A9_MAGIC I_MAGIC
-#elif defined(__x86_64__)
-  #define A9_MAGIC S_MAGIC
-#elif defined(__ia64__)
-  #define A9_MAGIC 0
-#else
-#error "Unsupported architecture"
-#endif
-
-#define round_pgup(_p)    (((_p)+(PAGE_SIZE-1))&PAGE_MASK)
-#define KZERO             0x80000000
-#define KOFFSET(_p)       ((_p)&~KZERO)
-
-static int parseaout9image(const char *, unsigned long, struct 
domain_setup_info *);
-static int loadaout9image(const char *, unsigned long, int, uint32_t, 
xen_pfn_t *, struct domain_setup_info *);
-static void copyout(int, uint32_t, unsigned long *, unsigned long, const char 
*, int);
-struct Exec *get_header(const char *, unsigned long, struct Exec *);
-
-
-int
-probe_aout9(
-    const char *image,
-    unsigned long image_size,
-    struct load_funcs *load_funcs)
-{
-    struct Exec ehdr;
-
-    if (!get_header(image, image_size, &ehdr)) {
-        ERROR("Kernel image does not have a a.out9 header.");
-        return -EINVAL;
-    }
-
-    load_funcs->parseimage = parseaout9image;
-    load_funcs->loadimage = loadaout9image;
-    return 0;
-}
-
-static int
-parseaout9image(
-    const char *image,
-    unsigned long image_size,
-    struct domain_setup_info *dsi)
-{
-    struct Exec ehdr;
-    unsigned long start, dstart, end;
-
-    if (!get_header(image, image_size, &ehdr)) {
-        ERROR("Kernel image does not have a a.out9 header.");
-        return -EINVAL;
-    }
-
-    if (sizeof ehdr + ehdr.text + ehdr.data > image_size) {
-        ERROR("a.out program extends past end of image.");
-        return -EINVAL;
-    }
-
-    start = ehdr.entry;
-    dstart = round_pgup(start + ehdr.text);
-    end = dstart + ehdr.data + ehdr.bss;
-
-    dsi->v_start     = KZERO;
-    dsi->v_kernstart = start;
-    dsi->v_kernend   = end;
-    dsi->v_kernentry = ehdr.entry;
-    dsi->v_end       = end;
-
-    /* XXX load symbols */
-
-    return 0;
-}
-
-static int
-loadaout9image(
-    const char *image,
-    unsigned long image_size,
-    int xch, uint32_t dom,
-    xen_pfn_t *parray,
-    struct domain_setup_info *dsi)
-{
-    struct Exec ehdr;
-    unsigned long start, dstart;
-
-    if (!get_header(image, image_size, &ehdr)) {
-        ERROR("Kernel image does not have a a.out9 header.");
-        return -EINVAL;
-    }
-
-    start = ehdr.entry;
-    dstart = round_pgup(start + ehdr.text);
-    copyout(xch, dom, parray, start, image + sizeof ehdr, ehdr.text);
-    copyout(xch, dom, parray, dstart,
-            image + sizeof ehdr + ehdr.text, ehdr.data);
-
-    /* XXX load symbols */
-
-    return 0;
-}
-
-/*
- * copyout data to the domain given an offset to the start
- * of its memory region described by parray.
- */
-static void
-copyout(
-    int xch, uint32_t dom,
-    unsigned long *parray,
-    unsigned long addr,
-    const char *buf,
-    int sz)
-{
-    unsigned long pgoff, chunksz, off;
-    void *pg;
-
-    off = KOFFSET(addr);
-    while (sz > 0) {
-        pgoff = off & (PAGE_SIZE-1);
-        chunksz = sz;
-        if(chunksz > PAGE_SIZE - pgoff)
-            chunksz = PAGE_SIZE - pgoff;
-
-        pg = xc_map_foreign_range(xch, dom, PAGE_SIZE, PROT_WRITE,
-                                  parray[off>>PAGE_SHIFT]);
-        memcpy(pg + pgoff, buf, chunksz);
-        munmap(pg, PAGE_SIZE);
-
-        off += chunksz;
-        buf += chunksz;
-        sz -= chunksz;
-    }
-}
-
-#define swap16(_v) ((((uint16_t)(_v)>>8)&0xff)|(((uint16_t)(_v)&0xff)<<8))
-#define swap32(_v) 
(((uint32_t)swap16((uint16_t)(_v))<<16)|(uint32_t)swap16((uint32_t)((_v)>>16)))
-
-/*
- * Decode the header from the start of image and return it.
- */
-struct Exec *
-get_header(
-    const char *image,
-    unsigned long image_size,
-    struct Exec *ehdr)
-{
-    uint32_t *v, x;
-    int i;
-
-    if (A9_MAGIC == 0)
-        return 0;
-
-    if (image_size < sizeof ehdr)
-        return 0;
-
-    /* ... all big endian words */
-    v = (uint32_t *)ehdr;
-    for (i = 0; i < sizeof(*ehdr); i += 4) {
-        x = *(uint32_t *)&image[i];
-        v[i/4] = swap32(x);
-    }
-
-    if(ehdr->magic != A9_MAGIC)
-        return 0;
-    return ehdr;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.