/[gxemul]/trunk/src/devices/makeautodev.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/devices/makeautodev.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4 by dpavlin, Mon Oct 8 16:18:00 2007 UTC revision 22 by dpavlin, Mon Oct 8 16:19:37 2007 UTC
# Line 27  Line 27 
27  #  SUCH DAMAGE.  #  SUCH DAMAGE.
28  #  #
29  #  #
30  #  $Id: makeautodev.sh,v 1.2 2005/02/22 13:23:43 debug Exp $  #  $Id: makeautodev.sh,v 1.6 2006/02/09 20:02:59 debug Exp $
31    
32    
33  printf "Generating autodev.c... "  printf "Generating autodev.c... "
34    
# Line 37  printf "/*\n *  DO NOT EDIT. AUTOMATICAL Line 38  printf "/*\n *  DO NOT EDIT. AUTOMATICAL
38    
39  cat autodev_head.c >> autodev.c  cat autodev_head.c >> autodev.c
40    
41  for a in `echo dev_*.o`; do  printf "4"
42          B=`echo $a|cut -c5-|sed s/\\\\.o//g`  for a in dev_*.c; do
43          if grep devinit_$B dev_$B.c > /dev/null; then          B=`grep DEVINIT $a`
44                  printf "int devinit_$B(struct devinit *);\n" >> autodev.c          if [ z"$B" != z ]; then
45                    C=`grep DEVINIT $a | cut -d \( -f 2|cut -d \) -f 1`
46                    for B in $C; do
47                            printf "int devinit_$B(struct devinit *);\n" >> autodev.c
48                    done
49            fi
50    done
51    
52    printf "3"
53    for a in bus_pci.c; do
54            B=`grep PCIINIT $a`
55            if [ z"$B" != z ]; then
56                    C=`grep PCIINIT $a | cut -d \( -f 2|cut -d \) -f 1`
57                    for B in $C; do
58                            printf "void pciinit_$B(struct machine *, " >> autodev.c
59                            printf "struct memory *, struct pci_device *);\n" >> autodev.c
60                    done
61          fi          fi
62  done  done
63    
64  cat autodev_middle.c >> autodev.c  cat autodev_middle.c >> autodev.c
65    
66  for a in `echo dev_*.o`; do  printf "2"
67          B=`echo $a|cut -c5-|sed s/\\\\.o//g`  for a in dev_*.c; do
68          if grep devinit_$B dev_$B.c > /dev/null; then          B=`grep DEVINIT $a`
69                  printf "\tdevice_register(\""$B"\"," >> autodev.c          if [ z"$B" != z ]; then
70                  printf " devinit_$B);\n" >> autodev.c                  C=`grep DEVINIT $a | cut -d \( -f 2|cut -d \) -f 1`
71                    for B in $C; do
72                            printf "\tdevice_register(\""$B"\"," >> autodev.c
73                            printf " devinit_$B);\n" >> autodev.c
74                    done
75            fi
76    done
77    
78    printf "1"
79    for a in bus_pci.c; do
80            B=`grep PCIINIT $a`
81            if [ z"$B" != z ]; then
82                    C=`grep PCIINIT $a | cut -d \( -f 2|cut -d \) -f 1`
83                    for B in $C; do
84                            printf "\tpci_register(\""$B"\"," >> autodev.c
85                            printf " pciinit_$B);\n" >> autodev.c
86                    done
87          fi          fi
88  done  done
89    
90  cat autodev_tail.c >> autodev.c  cat autodev_tail.c >> autodev.c
91    
92  printf "done\n"  printf " done\n"

Legend:
Removed from v.4  
changed lines
  Added in v.22

  ViewVC Help
Powered by ViewVC 1.1.26