ia64/xen-unstable

changeset 725:7c770d3613cf

bitkeeper revision 1.430 (3f68906fgsn_7B-4tWpePBu1MBZE_A)

Merge scramble.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into scramble.cl.cam.ac.uk:/local/scratch/kaf24/xeno
author kaf24@scramble.cl.cam.ac.uk
date Wed Sep 17 16:48:47 2003 +0000 (2003-09-17)
parents 115b02b108a1 efd1ad397eb3
children 3c39b32327e1 428e0cac6ccb
files .rootkeys tools/control/src/org/xenoserver/control/PartitionManager.java tools/control/src/org/xenoserver/control/Settings.java xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/balloon.c xenolinux-2.4.22-sparse/arch/xeno/drivers/block/Makefile xenolinux-2.4.22-sparse/arch/xeno/drivers/block/info.c xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_segment_proc.c xenolinux-2.4.22-sparse/arch/xeno/drivers/dom0/dom0_core.c xenolinux-2.4.22-sparse/arch/xeno/drivers/dom0/vfr.c xenolinux-2.4.22-sparse/arch/xeno/kernel/i386_ksyms.c xenolinux-2.4.22-sparse/arch/xeno/lib/Makefile xenolinux-2.4.22-sparse/arch/xeno/lib/xeno_proc.c xenolinux-2.4.22-sparse/drivers/block/genhd.c xenolinux-2.4.22-sparse/drivers/block/ll_rw_blk.c xenolinux-2.4.22-sparse/drivers/char/tty_io.c xenolinux-2.4.22-sparse/include/asm-xeno/xeno_proc.h
line diff
     1.1 --- a/.rootkeys	Wed Sep 17 10:39:03 2003 +0000
     1.2 +++ b/.rootkeys	Wed Sep 17 16:48:47 2003 +0000
     1.3 @@ -524,6 +524,7 @@ 3e6377f5xwPfYZkPHPrDbEq1PRN7uQ xenolinux
     1.4  3e6377f8Me8IqtvEhb70XFgOvqQH7A xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/balloon.c
     1.5  3e6377fbMjXWAQd0XN0FWv4fDEo6fg xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/dom_mem_ops.h
     1.6  3e5a4e65iHEuC5sjFhj42XALYbLVRw xenolinux-2.4.22-sparse/arch/xeno/drivers/block/Makefile
     1.7 +3f689056Vxx_8K8DQTRysOxx_ikmLg xenolinux-2.4.22-sparse/arch/xeno/drivers/block/info.c
     1.8  3e5a4e65pP5spJErBW69pJxSSdK9RA xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.c
     1.9  3e67f822FOPwqHiaRKbrskgWgoNL5g xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.h
    1.10  3e677190SjkzJIvFifRVeYpIZOCtYA xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_ide.c
    1.11 @@ -552,13 +553,13 @@ 3e5a4e66N__lUXNwzQ-eADRzK9LXuQ xenolinux
    1.12  3e5a4e66aHCbQ_F5QZ8VeyikLmuRZQ xenolinux-2.4.22-sparse/arch/xeno/kernel/traps.c
    1.13  3e5a4e66-9_NczrVMbuQkoSLyXckIw xenolinux-2.4.22-sparse/arch/xeno/lib/Makefile
    1.14  3e5a4e6637ZDk0BvFEC-aFQs599-ng xenolinux-2.4.22-sparse/arch/xeno/lib/delay.c
    1.15 +3f68905cF5i8-NYpIhGjKmh0y8Gu5g xenolinux-2.4.22-sparse/arch/xeno/lib/xeno_proc.c
    1.16  3e5a4e66croVgpcJyJuF2ycQw0HuJw xenolinux-2.4.22-sparse/arch/xeno/mm/Makefile
    1.17  3e5a4e66l8Q5Tv-6B3lQIRmaVbFPzg xenolinux-2.4.22-sparse/arch/xeno/mm/fault.c
    1.18  3e5a4e668SE9rixq4ahho9rNhLUUFQ xenolinux-2.4.22-sparse/arch/xeno/mm/hypervisor.c
    1.19  3e5a4e661gLzzff25pJooKIIWe7IWg xenolinux-2.4.22-sparse/arch/xeno/mm/init.c
    1.20  3f0bed43UUdQichXAiVNrjV-y2Kzcg xenolinux-2.4.22-sparse/arch/xeno/mm/ioremap.c
    1.21  3e5a4e66qRlSTcjafidMB6ulECADvg xenolinux-2.4.22-sparse/arch/xeno/vmlinux.lds
    1.22 -3ea53c6em6uzVHSiGqrbbAVofyRY_g xenolinux-2.4.22-sparse/drivers/block/genhd.c
    1.23  3e5a4e66mrtlmV75L1tjKDg8RaM5gA xenolinux-2.4.22-sparse/drivers/block/ll_rw_blk.c
    1.24  3f108aeaLcGDgQdFAANLTUEid0a05w xenolinux-2.4.22-sparse/drivers/char/mem.c
    1.25  3e5a4e66rw65CxyolW9PKz4GG42RcA xenolinux-2.4.22-sparse/drivers/char/tty_io.c
    1.26 @@ -589,6 +590,7 @@ 3e5a4e68uJz-xI0IBVMD7xRLQKJDFg xenolinux
    1.27  3e5a4e68Nfdh6QcOKUTGCaYkf2LmYA xenolinux-2.4.22-sparse/include/asm-xeno/smp.h
    1.28  3e5a4e68mTr0zcp9SXDbnd-XLrrfxw xenolinux-2.4.22-sparse/include/asm-xeno/system.h
    1.29  3f1056a9L_kqHcFheV00KbKBzv9j5w xenolinux-2.4.22-sparse/include/asm-xeno/vga.h
    1.30 +3f689063nhrIRsMMZjZxMFk7iEINqQ xenolinux-2.4.22-sparse/include/asm-xeno/xeno_proc.h
    1.31  3f056927gMHl7mWB89rb73JahbhQIA xenolinux-2.4.22-sparse/include/linux/blk.h
    1.32  3e5a4e68WLX3B8owTvktP3HHOtznPQ xenolinux-2.4.22-sparse/include/linux/major.h
    1.33  3e5a4e686V0nioX2ZpFf056sgvdiQw xenolinux-2.4.22-sparse/include/linux/sunrpc/debug.h
     2.1 --- a/tools/control/src/org/xenoserver/control/PartitionManager.java	Wed Sep 17 10:39:03 2003 +0000
     2.2 +++ b/tools/control/src/org/xenoserver/control/PartitionManager.java	Wed Sep 17 16:48:47 2003 +0000
     2.3 @@ -20,7 +20,7 @@ import java.util.Vector;
     2.4  public class PartitionManager {
     2.5      /** The proc header string, used to check that this is a suitable proc file. */
     2.6      private static final String PROC_TEMPLATE =
     2.7 -        "major minor  #blocks  start_sect   nr_sects name";
     2.8 +        "major minor start_sector  num_sectors name";
     2.9  
    2.10      /** The single PartitionManager reference. */
    2.11      public static final PartitionManager IT =
    2.12 @@ -59,12 +59,12 @@ public class PartitionManager {
    2.13              while (str != null) {
    2.14                  Partition partition =
    2.15                      new Partition(
    2.16 -                        Integer.parseInt(str.substring(0, 5).trim()),
    2.17 -                        Integer.parseInt(str.substring(5, 10).trim()),
    2.18 -                        Integer.parseInt(str.substring(10, 21).trim()),
    2.19 -                        Integer.parseInt(str.substring(21, 32).trim()),
    2.20 -                        Integer.parseInt(str.substring(32, 43).trim()),
    2.21 -                        str.substring(43).trim(),
    2.22 +                        Integer.parseInt(str.substring( 0,  5).trim()),
    2.23 +                        Integer.parseInt(str.substring( 6, 11).trim()),
    2.24 +                        Integer.parseInt(str.substring(25, 37).trim())/2,
    2.25 +                        Integer.parseInt(str.substring(12, 24).trim()),
    2.26 +                        Integer.parseInt(str.substring(25, 37).trim()),
    2.27 +                        str.substring(38).trim(),
    2.28                          false);
    2.29  
    2.30                  partition_map.add(partition);
     3.1 --- a/tools/control/src/org/xenoserver/control/Settings.java	Wed Sep 17 10:39:03 2003 +0000
     3.2 +++ b/tools/control/src/org/xenoserver/control/Settings.java	Wed Sep 17 16:48:47 2003 +0000
     3.3 @@ -21,7 +21,7 @@ public final class Settings {
     3.4          System.getProperty("XI_HELPER", "xi_helper");
     3.5      /** File to parse to get partition info. */
     3.6      public static final String PARTITIONS_FILE =
     3.7 -        System.getProperty("PARTITIONS_FILE", "/proc/partitions");
     3.8 +        System.getProperty("PARTITIONS_FILE", "/proc/xeno/blkdev_info");
     3.9      /** File to load virtual disk state from. */
    3.10      public static final String STATE_INPUT_FILE =
    3.11          System.getProperty("STATE_INPUT_FILE", "/var/lib/xen/vdstate.xml");
     4.1 --- a/xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/balloon.c	Wed Sep 17 10:39:03 2003 +0000
     4.2 +++ b/xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/balloon.c	Wed Sep 17 16:48:47 2003 +0000
     4.3 @@ -11,7 +11,7 @@
     4.4  #include <linux/kernel.h>
     4.5  #include <linux/sched.h>
     4.6  #include <linux/errno.h>
     4.7 -#include <linux/proc_fs.h>
     4.8 +#include <asm/xeno_proc.h>
     4.9  
    4.10  #include <linux/mm.h>
    4.11  #include <linux/mman.h>
    4.12 @@ -38,9 +38,6 @@ typedef struct user_balloon_op {
    4.13  /* Dead entry written into ballon-owned entries in the PMT. */
    4.14  #define DEAD 0xdeadbeef
    4.15  
    4.16 -#define BALLOON_ENTRY    "balloon"
    4.17 -extern struct proc_dir_entry *xeno_base;
    4.18 -
    4.19  static struct proc_dir_entry *balloon_pde;
    4.20  unsigned long credit;
    4.21  
    4.22 @@ -260,7 +257,7 @@ static int __init init_module(void)
    4.23  
    4.24      credit = 0;
    4.25  
    4.26 -    balloon_pde = create_proc_entry(BALLOON_ENTRY, 0600, xeno_base);
    4.27 +    balloon_pde = create_xeno_proc_entry("balloon", 0600);
    4.28      if ( balloon_pde == NULL )
    4.29      {
    4.30          printk(KERN_ALERT "Unable to create balloon driver proc entry!");
    4.31 @@ -274,6 +271,11 @@ static int __init init_module(void)
    4.32  
    4.33  static void __exit cleanup_module(void)
    4.34  {
    4.35 +    if ( balloon_pde != NULL )
    4.36 +    {
    4.37 +        remove_xeno_proc_entry("balloon");
    4.38 +        balloon_pde = NULL;
    4.39 +    }
    4.40  }
    4.41  
    4.42  module_init(init_module);
     5.1 --- a/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/Makefile	Wed Sep 17 10:39:03 2003 +0000
     5.2 +++ b/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/Makefile	Wed Sep 17 16:48:47 2003 +0000
     5.3 @@ -1,3 +1,3 @@
     5.4  O_TARGET := blk.o
     5.5 -obj-y := xl_block.o xl_ide.o xl_scsi.o xl_segment.o xl_segment_proc.o
     5.6 +obj-y := xl_block.o xl_ide.o xl_scsi.o xl_segment.o xl_segment_proc.o info.o
     5.7  include $(TOPDIR)/Rules.make
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/info.c	Wed Sep 17 16:48:47 2003 +0000
     6.3 @@ -0,0 +1,111 @@
     6.4 +
     6.5 +#include "xl_block.h"
     6.6 +#include <linux/blk.h>
     6.7 +#include <linux/cdrom.h>
     6.8 +#include <linux/genhd.h>
     6.9 +#include <linux/seq_file.h>
    6.10 +#include <asm/xeno_proc.h>
    6.11 +
    6.12 +static struct proc_dir_entry *info_pde;
    6.13 +
    6.14 +static void *info_start(struct seq_file *s, loff_t *ppos)
    6.15 +{
    6.16 +    struct gendisk *gp;
    6.17 +    loff_t pos = *ppos;
    6.18 +    int major;
    6.19 +
    6.20 +    if ( pos == 0 )
    6.21 +        seq_puts(s, "major minor start_sector  num_sectors name\n\n");
    6.22 +
    6.23 +    for ( major = 0; major < MAX_BLKDEV; major++ )
    6.24 +    {
    6.25 +        if ( (gp = get_gendisk(MKDEV(major, 0))) != 0 )
    6.26 +            if ( !pos-- )
    6.27 +                return gp;
    6.28 +    }
    6.29 +
    6.30 +    return NULL;
    6.31 +}
    6.32 +
    6.33 +static void *info_next(struct seq_file *s, void *v, loff_t *ppos)
    6.34 +{
    6.35 +    ++*ppos;
    6.36 +    return info_start(s, ppos);
    6.37 +}
    6.38 +
    6.39 +static void info_stop(struct seq_file *s, void *v)
    6.40 +{
    6.41 +}
    6.42 +
    6.43 +static int info_show(struct seq_file *s, void *v)
    6.44 +{
    6.45 +    struct gendisk *gp = v;
    6.46 +    char buf[64];
    6.47 +    int n, disk;
    6.48 +    
    6.49 +    for ( n = 0; n < (gp->nr_real << gp->minor_shift); n++ ) 
    6.50 +    {
    6.51 +        disk = n >> gp->minor_shift;
    6.52 +        if ( gp->part[n].nr_sects != 0 ) 
    6.53 +        {
    6.54 +            seq_printf(s, "%5d %5d %12ld %12ld %s\n",
    6.55 +                       gp->major, n,
    6.56 +                       gp->part[n].start_sect,
    6.57 +                       gp->part[n].nr_sects,
    6.58 +                       disk_name(gp, n, buf));
    6.59 +        }
    6.60 +        else if ( ((disk << gp->minor_shift) == n) &&
    6.61 +                  ((((xl_disk_t *)gp->real_devices)[disk].capacity) != 0) )
    6.62 +        {
    6.63 +            seq_printf(s, "%5d %5d %12d %12ld %s\n",
    6.64 +                       gp->major, n, 0, 
    6.65 +                       ((xl_disk_t *)gp->real_devices)[disk].capacity,
    6.66 +                       disk_name(gp, n, buf));
    6.67 +        }
    6.68 +    }
    6.69 +    
    6.70 +    return 0;
    6.71 +}
    6.72 +
    6.73 +static struct seq_operations info_op = {
    6.74 +    .start          = info_start,
    6.75 +    .next           = info_next,
    6.76 +    .stop           = info_stop,
    6.77 +    .show           = info_show,
    6.78 +};
    6.79 +
    6.80 +static int info_open(struct inode *inode, struct file *file)
    6.81 +{
    6.82 +    return seq_open(file, &info_op);
    6.83 +}
    6.84 +
    6.85 +static struct file_operations proc_info_operations = 
    6.86 +{
    6.87 +    open:           info_open,
    6.88 +    read:           seq_read,
    6.89 +    llseek:         seq_lseek,
    6.90 +    release:        seq_release,
    6.91 +};
    6.92 +
    6.93 +int __init info_init(void)
    6.94 +{
    6.95 +    info_pde = create_xeno_proc_entry("blkdev_info", 0444);
    6.96 +    if ( info_pde == NULL )
    6.97 +        panic ("Couldn't create /proc/xeno/blkdev_info");
    6.98 +
    6.99 +    info_pde->data       = NULL;
   6.100 +    info_pde->proc_fops  = &proc_info_operations;
   6.101 +    info_pde->owner      = THIS_MODULE;
   6.102 +
   6.103 +    return 0;
   6.104 +}
   6.105 +
   6.106 +static void __exit info_exit(void)
   6.107 +{
   6.108 +    if ( info_pde == NULL ) return;
   6.109 +    remove_xeno_proc_entry("blkdev_info");
   6.110 +    info_pde = NULL;
   6.111 +}
   6.112 +
   6.113 +module_init(info_init);
   6.114 +module_exit(info_exit);
     7.1 --- a/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_segment_proc.c	Wed Sep 17 10:39:03 2003 +0000
     7.2 +++ b/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_segment_proc.c	Wed Sep 17 16:48:47 2003 +0000
     7.3 @@ -5,7 +5,7 @@
     7.4   */
     7.5  
     7.6  #include "xl_block.h"
     7.7 -#include <linux/proc_fs.h>
     7.8 +#include <asm/xeno_proc.h>
     7.9  #include <linux/delay.h>
    7.10  #include <linux/seq_file.h>
    7.11  #include <asm/hypervisor-ifs/segment.h>
    7.12 @@ -133,6 +133,9 @@ static int proc_write_vhd(struct file *f
    7.13      xv_disk_t xvd;
    7.14      int res;
    7.15  
    7.16 +    if( !(start_info.flags & SIF_PRIVILEGED) )
    7.17 +        return -EPERM;
    7.18 +
    7.19      if (!local)
    7.20        return -ENOMEM;
    7.21  
    7.22 @@ -310,7 +313,7 @@ int __init xlseg_proc_init(void)
    7.23      if ( !(start_info.flags & SIF_PRIVILEGED) )
    7.24          return 0;
    7.25  
    7.26 -    vhd = create_proc_entry("xeno/vhd", 0600, NULL);
    7.27 +    vhd = create_xeno_proc_entry("vhd", 0600);
    7.28      if ( vhd == NULL )
    7.29          panic ("xlseg_init: unable to create vhd proc entry\n");
    7.30  
    7.31 @@ -318,13 +321,14 @@ int __init xlseg_proc_init(void)
    7.32      vhd->proc_fops  = &proc_vhd_operations;
    7.33      vhd->owner      = THIS_MODULE;
    7.34  
    7.35 -    printk(KERN_ALERT "XenoLinux Virtual Disk Device Monitor installed\n");
    7.36      return 0;
    7.37  }
    7.38  
    7.39  static void __exit xlseg_proc_cleanup(void)
    7.40  {
    7.41 -    printk(KERN_ALERT "XenoLinux Virtual Disk Device Monitor uninstalled\n");
    7.42 +    if ( vhd == NULL ) return;
    7.43 +    remove_xeno_proc_entry("vhd");
    7.44 +    vhd = NULL;
    7.45  }
    7.46  
    7.47  #ifdef MODULE
     8.1 --- a/xenolinux-2.4.22-sparse/arch/xeno/drivers/dom0/dom0_core.c	Wed Sep 17 10:39:03 2003 +0000
     8.2 +++ b/xenolinux-2.4.22-sparse/arch/xeno/drivers/dom0/dom0_core.c	Wed Sep 17 16:48:47 2003 +0000
     8.3 @@ -13,7 +13,6 @@
     8.4  #include <linux/slab.h>
     8.5  #include <linux/string.h>
     8.6  #include <linux/errno.h>
     8.7 -#include <linux/proc_fs.h>
     8.8  #include <linux/mm.h>
     8.9  #include <linux/mman.h>
    8.10  #include <linux/swap.h>
    8.11 @@ -30,10 +29,10 @@
    8.12  #include <asm/tlb.h>
    8.13  #include <asm/proc_cmd.h>
    8.14  #include <asm/hypervisor-ifs/dom0_ops.h>
    8.15 +#include <asm/xeno_proc.h>
    8.16  
    8.17  #include "../block/xl_block.h"
    8.18  
    8.19 -struct proc_dir_entry *xeno_base;
    8.20  static struct proc_dir_entry *privcmd_intf;
    8.21  
    8.22  
    8.23 @@ -133,11 +132,8 @@ static int __init init_module(void)
    8.24      if ( !(start_info.flags & SIF_PRIVILEGED) )
    8.25          return 0;
    8.26  
    8.27 -    /* xeno proc root setup */
    8.28 -    xeno_base = proc_mkdir("xeno", &proc_root); 
    8.29 -
    8.30      /* xeno control interface */
    8.31 -    privcmd_intf = create_proc_entry("privcmd", 0400, xeno_base);
    8.32 +    privcmd_intf = create_xeno_proc_entry("privcmd", 0400);
    8.33      if ( privcmd_intf != NULL )
    8.34      {
    8.35          privcmd_intf->owner      = THIS_MODULE;
    8.36 @@ -152,7 +148,7 @@ static int __init init_module(void)
    8.37  static void __exit cleanup_module(void)
    8.38  {
    8.39      if ( privcmd_intf == NULL ) return;
    8.40 -    remove_proc_entry("xeno", &proc_root);
    8.41 +    remove_xeno_proc_entry("privcmd");
    8.42      privcmd_intf = NULL;
    8.43  }
    8.44  
     9.1 --- a/xenolinux-2.4.22-sparse/arch/xeno/drivers/dom0/vfr.c	Wed Sep 17 10:39:03 2003 +0000
     9.2 +++ b/xenolinux-2.4.22-sparse/arch/xeno/drivers/dom0/vfr.c	Wed Sep 17 16:48:47 2003 +0000
     9.3 @@ -12,16 +12,13 @@
     9.4  #include <linux/slab.h>
     9.5  #include <linux/string.h>
     9.6  #include <linux/errno.h>
     9.7 -#include <linux/proc_fs.h>
     9.8 -
     9.9 +#include <asm/xeno_proc.h>
    9.10  #include <asm/hypervisor-ifs/network.h>
    9.11  
    9.12  static struct proc_dir_entry *proc_vfr;
    9.13  
    9.14  static unsigned char readbuf[1024];
    9.15  
    9.16 -extern struct proc_dir_entry *xeno_base;
    9.17 -
    9.18  /* Helpers, implemented at the bottom. */
    9.19  u32 getipaddr(const char *buff, unsigned int len);
    9.20  u16 antous(const char *buff, int len);
    9.21 @@ -225,8 +222,11 @@ static int vfr_write_proc(struct file *f
    9.22  
    9.23  static int __init init_module(void)
    9.24  {
    9.25 +    if ( !(start_info.flags & SIF_PRIVILEGED) )
    9.26 +        return 0;
    9.27 +
    9.28      *readbuf = '\0';
    9.29 -    proc_vfr = create_proc_entry ("vfr", 0600, xeno_base);
    9.30 +    proc_vfr = create_xeno_proc_entry("vfr", 0600);
    9.31      if ( proc_vfr != NULL )
    9.32      {
    9.33          proc_vfr->owner      = THIS_MODULE;
    9.34 @@ -241,7 +241,7 @@ static int __init init_module(void)
    9.35  static void __exit cleanup_module(void)
    9.36  {
    9.37      if ( proc_vfr == NULL ) return;
    9.38 -    remove_proc_entry("vfr", xeno_base);
    9.39 +    remove_xeno_proc_entry("vfr");
    9.40      proc_vfr = NULL;
    9.41  }
    9.42  
    10.1 --- a/xenolinux-2.4.22-sparse/arch/xeno/kernel/i386_ksyms.c	Wed Sep 17 10:39:03 2003 +0000
    10.2 +++ b/xenolinux-2.4.22-sparse/arch/xeno/kernel/i386_ksyms.c	Wed Sep 17 16:48:47 2003 +0000
    10.3 @@ -152,3 +152,8 @@ EXPORT_SYMBOL(atomic_dec_and_lock);
    10.4  #ifdef CONFIG_MULTIQUAD
    10.5  EXPORT_SYMBOL(xquad_portio);
    10.6  #endif
    10.7 +
    10.8 +#include <asm/xeno_proc.h>
    10.9 +EXPORT_SYMBOL(create_xeno_proc_entry);
   10.10 +EXPORT_SYMBOL(remove_xeno_proc_entry);
   10.11 +
    11.1 --- a/xenolinux-2.4.22-sparse/arch/xeno/lib/Makefile	Wed Sep 17 10:39:03 2003 +0000
    11.2 +++ b/xenolinux-2.4.22-sparse/arch/xeno/lib/Makefile	Wed Sep 17 16:48:47 2003 +0000
    11.3 @@ -6,7 +6,7 @@ L_TARGET = lib.a
    11.4  
    11.5  obj-y = checksum.o old-checksum.o delay.o \
    11.6  	usercopy.o getuser.o \
    11.7 -	memcpy.o strstr.o
    11.8 +	memcpy.o strstr.o xeno_proc.o
    11.9  
   11.10  obj-$(CONFIG_X86_USE_3DNOW) += mmx.o
   11.11  obj-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/xenolinux-2.4.22-sparse/arch/xeno/lib/xeno_proc.c	Wed Sep 17 16:48:47 2003 +0000
    12.3 @@ -0,0 +1,18 @@
    12.4 +
    12.5 +#include <linux/config.h>
    12.6 +#include <linux/proc_fs.h>
    12.7 +
    12.8 +static struct proc_dir_entry *xeno_base;
    12.9 +
   12.10 +struct proc_dir_entry *create_xeno_proc_entry(const char *name, mode_t mode)
   12.11 +{
   12.12 +    if ( xeno_base == NULL )
   12.13 +        if ( (xeno_base = proc_mkdir("xeno", &proc_root)) == NULL )
   12.14 +            panic("Couldn't create /proc/xeno");
   12.15 +    return create_proc_entry(name, mode, xeno_base);
   12.16 +}
   12.17 +
   12.18 +void remove_xeno_proc_entry(const char *name)
   12.19 +{
   12.20 +    remove_proc_entry(name, xeno_base);
   12.21 +}
    13.1 --- a/xenolinux-2.4.22-sparse/drivers/block/genhd.c	Wed Sep 17 10:39:03 2003 +0000
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,258 +0,0 @@
    13.4 -/*
    13.5 - *  Code extracted from
    13.6 - *  linux/kernel/hd.c
    13.7 - *
    13.8 - *  Copyright (C) 1991-1998  Linus Torvalds
    13.9 - *
   13.10 - *  devfs support - jj, rgooch, 980122
   13.11 - *
   13.12 - *  Moved partition checking code to fs/partitions* - Russell King
   13.13 - *  (linux@arm.uk.linux.org)
   13.14 - */
   13.15 -
   13.16 -/*
   13.17 - * TODO:  rip out the remaining init crap from this file  --hch
   13.18 - */
   13.19 -
   13.20 -#include <linux/config.h>
   13.21 -#include <linux/module.h>
   13.22 -#include <linux/fs.h>
   13.23 -#include <linux/genhd.h>
   13.24 -#include <linux/kernel.h>
   13.25 -#include <linux/blk.h>
   13.26 -#include <linux/init.h>
   13.27 -#include <linux/spinlock.h>
   13.28 -#include <linux/seq_file.h>
   13.29 -
   13.30 -
   13.31 -/*
   13.32 - * Global kernel list of partitioning information.
   13.33 - *
   13.34 - * XXX: you should _never_ access this directly.
   13.35 - *	the only reason this is exported is source compatiblity.
   13.36 - */
   13.37 -/*static*/ struct gendisk *gendisk_head;
   13.38 -static struct gendisk *gendisk_array[MAX_BLKDEV];
   13.39 -static rwlock_t gendisk_lock = RW_LOCK_UNLOCKED;
   13.40 -
   13.41 -EXPORT_SYMBOL(gendisk_head);
   13.42 -
   13.43 -
   13.44 -/**
   13.45 - * add_gendisk - add partitioning information to kernel list
   13.46 - * @gp: per-device partitioning information
   13.47 - *
   13.48 - * This function registers the partitioning information in @gp
   13.49 - * with the kernel.
   13.50 - */
   13.51 -void
   13.52 -add_gendisk(struct gendisk *gp)
   13.53 -{
   13.54 -	struct gendisk *sgp;
   13.55 -
   13.56 -	write_lock(&gendisk_lock);
   13.57 -
   13.58 -	/*
   13.59 - 	 *	In 2.5 this will go away. Fix the drivers who rely on
   13.60 - 	 *	old behaviour.
   13.61 - 	 */
   13.62 -
   13.63 -	for (sgp = gendisk_head; sgp; sgp = sgp->next)
   13.64 -	{
   13.65 -		if (sgp == gp)
   13.66 -		{
   13.67 -//			printk(KERN_ERR "add_gendisk: device major %d is buggy and added a live gendisk!\n",
   13.68 -//				sgp->major)
   13.69 -			goto out;
   13.70 -		}
   13.71 -	}
   13.72 -	gendisk_array[gp->major] = gp;
   13.73 -	gp->next = gendisk_head;
   13.74 -	gendisk_head = gp;
   13.75 -out:
   13.76 -	write_unlock(&gendisk_lock);
   13.77 -}
   13.78 -
   13.79 -EXPORT_SYMBOL(add_gendisk);
   13.80 -
   13.81 -
   13.82 -/**
   13.83 - * del_gendisk - remove partitioning information from kernel list
   13.84 - * @gp: per-device partitioning information
   13.85 - *
   13.86 - * This function unregisters the partitioning information in @gp
   13.87 - * with the kernel.
   13.88 - */
   13.89 -void
   13.90 -del_gendisk(struct gendisk *gp)
   13.91 -{
   13.92 -	struct gendisk **gpp;
   13.93 -
   13.94 -	write_lock(&gendisk_lock);
   13.95 -	gendisk_array[gp->major] = NULL;
   13.96 -	for (gpp = &gendisk_head; *gpp; gpp = &((*gpp)->next))
   13.97 -		if (*gpp == gp)
   13.98 -			break;
   13.99 -	if (*gpp)
  13.100 -		*gpp = (*gpp)->next;
  13.101 -	write_unlock(&gendisk_lock);
  13.102 -}
  13.103 -
  13.104 -EXPORT_SYMBOL(del_gendisk);
  13.105 -
  13.106 -
  13.107 -/**
  13.108 - * get_gendisk - get partitioning information for a given device
  13.109 - * @dev: device to get partitioning information for
  13.110 - *
  13.111 - * This function gets the structure containing partitioning
  13.112 - * information for the given device @dev.
  13.113 - */
  13.114 -struct gendisk *
  13.115 -get_gendisk(kdev_t dev)
  13.116 -{
  13.117 -	struct gendisk *gp = NULL;
  13.118 -	int maj = MAJOR(dev);
  13.119 -
  13.120 -	read_lock(&gendisk_lock);
  13.121 -	if ((gp = gendisk_array[maj]))
  13.122 -		goto out;
  13.123 -
  13.124 -	/* This is needed for early 2.4 source compatiblity.  --hch */
  13.125 -	for (gp = gendisk_head; gp; gp = gp->next)
  13.126 -		if (gp->major == maj)
  13.127 -			break;
  13.128 -out:
  13.129 -	read_unlock(&gendisk_lock);
  13.130 -	return gp;
  13.131 -}
  13.132 -
  13.133 -EXPORT_SYMBOL(get_gendisk);
  13.134 -
  13.135 -
  13.136 -/**
  13.137 - * walk_gendisk - issue a command for every registered gendisk
  13.138 - * @walk: user-specified callback
  13.139 - * @data: opaque data for the callback
  13.140 - *
  13.141 - * This function walks through the gendisk chain and calls back
  13.142 - * into @walk for every element.
  13.143 - */
  13.144 -int
  13.145 -walk_gendisk(int (*walk)(struct gendisk *, void *), void *data)
  13.146 -{
  13.147 -	struct gendisk *gp;
  13.148 -	int error = 0;
  13.149 -
  13.150 -	read_lock(&gendisk_lock);
  13.151 -	for (gp = gendisk_head; gp; gp = gp->next)
  13.152 -		if ((error = walk(gp, data)))
  13.153 -			break;
  13.154 -	read_unlock(&gendisk_lock);
  13.155 -
  13.156 -	return error;
  13.157 -}
  13.158 -
  13.159 -#ifdef CONFIG_PROC_FS
  13.160 -/* iterator */
  13.161 -static void *part_start(struct seq_file *s, loff_t *ppos)
  13.162 -{
  13.163 -	struct gendisk *gp;
  13.164 -	loff_t pos = *ppos;
  13.165 -
  13.166 -	read_lock(&gendisk_lock);
  13.167 -	for (gp = gendisk_head; gp; gp = gp->next)
  13.168 -		if (!pos--)
  13.169 -			return gp;
  13.170 -	return NULL;
  13.171 -}
  13.172 -
  13.173 -static void *part_next(struct seq_file *s, void *v, loff_t *pos)
  13.174 -{
  13.175 -	++*pos;
  13.176 -	return ((struct gendisk *)v)->next;
  13.177 -}
  13.178 -
  13.179 -static void part_stop(struct seq_file *s, void *v)
  13.180 -{
  13.181 -	read_unlock(&gendisk_lock);
  13.182 -}
  13.183 -
  13.184 -static int part_show(struct seq_file *s, void *v)
  13.185 -{
  13.186 -	struct gendisk *gp = v;
  13.187 -	char buf[64];
  13.188 -	int n;
  13.189 -
  13.190 -	if (gp == gendisk_head) {
  13.191 -		seq_puts(s, "major minor  #blocks  start_sect   nr_sects name"
  13.192 -#ifdef CONFIG_BLK_STATS
  13.193 -			    "     rio rmerge rsect ruse wio wmerge "
  13.194 -			    "wsect wuse running use aveq"
  13.195 -#endif
  13.196 -			   "\n\n");
  13.197 -	}
  13.198 -
  13.199 -	/* show the full disk and all non-0 size partitions of it */
  13.200 -	for (n = 0; n < (gp->nr_real << gp->minor_shift); n++) {
  13.201 -		if (gp->part[n].nr_sects) {
  13.202 -#ifdef CONFIG_BLK_STATS
  13.203 -			struct hd_struct *hd = &gp->part[n];
  13.204 -
  13.205 -			disk_round_stats(hd);
  13.206 -			seq_printf(s, "%4d  %4d %10d %10ld %s "
  13.207 -				      "%d %d %d %d %d %d %d %d %d %d %d\n",
  13.208 -				      gp->major, n, gp->sizes[n],
  13.209 -				      gp->part[n].start_sect,
  13.210 -				      gp->part[n].nr_sects,
  13.211 -				      disk_name(gp, n, buf),
  13.212 -				      hd->rd_ios, hd->rd_merges,
  13.213 -#define MSEC(x) ((x) * 1000 / HZ)
  13.214 -				      hd->rd_sectors, MSEC(hd->rd_ticks),
  13.215 -				      hd->wr_ios, hd->wr_merges,
  13.216 -				      hd->wr_sectors, MSEC(hd->wr_ticks),
  13.217 -				      hd->ios_in_flight, MSEC(hd->io_ticks),
  13.218 -				      MSEC(hd->aveq));
  13.219 -#else
  13.220 -			seq_printf(s, "%4d  %4d %10d %10ld %10ld %s\n",
  13.221 -				   gp->major, n, gp->sizes[n],
  13.222 -				   gp->part[n].start_sect,
  13.223 -				   gp->part[n].nr_sects,
  13.224 -				   disk_name(gp, n, buf));
  13.225 -#endif /* CONFIG_BLK_STATS */
  13.226 -		}
  13.227 -	}
  13.228 -
  13.229 -	return 0;
  13.230 -}
  13.231 -
  13.232 -struct seq_operations partitions_op = {
  13.233 -	.start		= part_start,
  13.234 -	.next		= part_next,
  13.235 -	.stop		= part_stop,
  13.236 -	.show		= part_show,
  13.237 -};
  13.238 -#endif
  13.239 -
  13.240 -extern int blk_dev_init(void);
  13.241 -extern int net_dev_init(void);
  13.242 -extern void console_map_init(void);
  13.243 -extern int atmdev_init(void);
  13.244 -
  13.245 -int __init device_init(void)
  13.246 -{
  13.247 -	blk_dev_init();
  13.248 -	sti();
  13.249 -#ifdef CONFIG_NET
  13.250 -	net_dev_init();
  13.251 -#endif
  13.252 -#ifdef CONFIG_ATM
  13.253 -	(void) atmdev_init();
  13.254 -#endif
  13.255 -#ifdef CONFIG_VT
  13.256 -	console_map_init();
  13.257 -#endif
  13.258 -	return 0;
  13.259 -}
  13.260 -
  13.261 -__initcall(device_init);
    14.1 --- a/xenolinux-2.4.22-sparse/drivers/block/ll_rw_blk.c	Wed Sep 17 10:39:03 2003 +0000
    14.2 +++ b/xenolinux-2.4.22-sparse/drivers/block/ll_rw_blk.c	Wed Sep 17 16:48:47 2003 +0000
    14.3 @@ -859,8 +859,6 @@ static inline void add_request(request_q
    14.4  
    14.5  	if (!q->plugged && q->head_active && insert_here == &q->queue_head) {
    14.6  		spin_unlock_irq(&io_request_lock);
    14.7 -		printk("list_empty(&q->queue_head) is %d\n", 
    14.8 -		       list_empty(&q->queue_head)); 
    14.9  		BUG();
   14.10  	}
   14.11  
    15.1 --- a/xenolinux-2.4.22-sparse/drivers/char/tty_io.c	Wed Sep 17 10:39:03 2003 +0000
    15.2 +++ b/xenolinux-2.4.22-sparse/drivers/char/tty_io.c	Wed Sep 17 16:48:47 2003 +0000
    15.3 @@ -842,9 +842,8 @@ static int init_dev(kdev_t device, struc
    15.4  	int idx;
    15.5  
    15.6  	driver = get_tty_driver(device);
    15.7 -	if (!driver) {
    15.8 -	  return -ENODEV;
    15.9 -	}
   15.10 +	if (!driver)
   15.11 +		return -ENODEV;
   15.12  
   15.13  	idx = MINOR(device) - driver->minor_start;
   15.14  
   15.15 @@ -2219,7 +2218,7 @@ int tty_unregister_driver(struct tty_dri
   15.16   */
   15.17  void __init console_init(void)
   15.18  {
   15.19 -        /* Setup the default TTY line discipline. */
   15.20 +	/* Setup the default TTY line discipline. */
   15.21  	memset(ldiscs, 0, sizeof(ldiscs));
   15.22  	(void) tty_register_ldisc(N_TTY, &tty_ldisc_N_TTY);
   15.23  
   15.24 @@ -2250,7 +2249,6 @@ void __init console_init(void)
   15.25  #ifdef CONFIG_VT
   15.26  	con_init();
   15.27  #endif
   15.28 -
   15.29  #ifdef CONFIG_AU1X00_SERIAL_CONSOLE
   15.30  	au1x00_serial_console_init();
   15.31  #endif
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/xenolinux-2.4.22-sparse/include/asm-xeno/xeno_proc.h	Wed Sep 17 16:48:47 2003 +0000
    16.3 @@ -0,0 +1,13 @@
    16.4 +
    16.5 +#ifndef __ASM_XENO_PROC_H__
    16.6 +#define __ASM_XENO_PROC_H__
    16.7 +
    16.8 +#include <linux/config.h>
    16.9 +#include <linux/proc_fs.h>
   16.10 +
   16.11 +extern struct proc_dir_entry *create_xeno_proc_entry(
   16.12 +    const char *name, mode_t mode);
   16.13 +extern void remove_xeno_proc_entry(
   16.14 +    const char *name);
   16.15 +
   16.16 +#endif /* __ASM_XENO_PROC_H__ */