SimpleOS

LXR

Navigation



Site hébergé par : enix

The LXR Cross Referencer for SOS

source navigation ]
diff markup ]
identifier search ]
general search ]
 
 
Article:1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 6.5 ] [ 7 ] [ 7.5 ] [ 8 ] [ 9 ] [ 9.5 ]

Diff markup

Differences between /extra/patch-qemu-port-e9.diff (Article 9) and /extra/patch-qemu-port-e9.diff (Article 9.5)


001                                                   001 
002 Patch to enable the "port 0xe9" debugging faci    002 Patch to enable the "port 0xe9" debugging facility in qemu (version
003 0.7.2). This input/output port is used extensi    003 0.7.2). This input/output port is used extensively in SOS to ease
004 debugging (the sos_bochs_printf family of func    004 debugging (the sos_bochs_printf family of functions).
005                                                   005 
006   -- Thomas Petazzoni and Christophe Lucas        006   -- Thomas Petazzoni and Christophe Lucas
007                                                   007 
008                                                   008 
009 diff -urpNX /usr/kernel/dontdiff qemu-0.7.2/hw    009 diff -urpNX /usr/kernel/dontdiff qemu-0.7.2/hw/pc.c qemu-0.7.2-clucas/hw/pc.c
010 --- qemu-0.7.2/hw/pc.c  2005-09-04 19:11:31.00    010 --- qemu-0.7.2/hw/pc.c  2005-09-04 19:11:31.000000000 +0200
011 +++ qemu-0.7.2-clucas/hw/pc.c   2005-09-14 11:    011 +++ qemu-0.7.2-clucas/hw/pc.c   2005-09-14 11:24:51.000000000 +0200
012 @@ -620,6 +620,12 @@ static void pc_init1(int     012 @@ -620,6 +620,12 @@ static void pc_init1(int ram_size, int v
013                                                   013  
014      cmos_init(ram_size, boot_device, bs_table    014      cmos_init(ram_size, boot_device, bs_table);
015                                                   015  
016 +       for(i=0 ; i<MAX_PORT_E9_PORTS ; i++) {    016 +       for(i=0 ; i<MAX_PORT_E9_PORTS ; i++) {
017 +               if (port_e9_hds[i]) {             017 +               if (port_e9_hds[i]) {
018 +                       port_e9_init(port_e9_h    018 +                       port_e9_init(port_e9_hds[i]);
019 +               }                                 019 +               }
020 +       }                                         020 +       }
021 +                                                 021 +
022      /* must be done after all PCI devices are    022      /* must be done after all PCI devices are instanciated */
023      /* XXX: should be done in the Bochs BIOS     023      /* XXX: should be done in the Bochs BIOS */
024      if (pci_enabled) {                           024      if (pci_enabled) {
025 diff -urpNX /usr/kernel/dontdiff qemu-0.7.2/Ma    025 diff -urpNX /usr/kernel/dontdiff qemu-0.7.2/Makefile.target qemu-0.7.2-clucas/Makefile.target
026 --- qemu-0.7.2/Makefile.target  2005-09-04 19:    026 --- qemu-0.7.2/Makefile.target  2005-09-04 19:11:31.000000000 +0200
027 +++ qemu-0.7.2-clucas/Makefile.target   2005-0    027 +++ qemu-0.7.2-clucas/Makefile.target   2005-09-14 11:24:50.000000000 +0200
028 @@ -286,7 +286,7 @@ endif                         028 @@ -286,7 +286,7 @@ endif
029  ifeq ($(TARGET_BASE_ARCH), i386)                 029  ifeq ($(TARGET_BASE_ARCH), i386)
030  # Hardware support                               030  # Hardware support
031  VL_OBJS+= ide.o ne2000.o pckbd.o vga.o $(SOUN    031  VL_OBJS+= ide.o ne2000.o pckbd.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
032 -VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.    032 -VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pc.o
033 +VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.    033 +VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pc.o port_e9.o
034  VL_OBJS+= cirrus_vga.o mixeng.o apic.o parall    034  VL_OBJS+= cirrus_vga.o mixeng.o apic.o parallel.o
035  endif                                            035  endif
036  ifeq ($(TARGET_BASE_ARCH), ppc)                  036  ifeq ($(TARGET_BASE_ARCH), ppc)
037 diff -urpNX /usr/kernel/dontdiff qemu-0.7.2/po    037 diff -urpNX /usr/kernel/dontdiff qemu-0.7.2/port_e9.c qemu-0.7.2-clucas/port_e9.c
038 --- qemu-0.7.2/port_e9.c        1970-01-01 01:    038 --- qemu-0.7.2/port_e9.c        1970-01-01 01:00:00.000000000 +0100
039 +++ qemu-0.7.2-clucas/port_e9.c 2005-09-14 11:    039 +++ qemu-0.7.2-clucas/port_e9.c 2005-09-14 11:24:51.000000000 +0200
040 @@ -0,0 +1,51 @@                                  040 @@ -0,0 +1,51 @@
041 +/*                                               041 +/*
042 + * QEMU Port 0xe9 hack                           042 + * QEMU Port 0xe9 hack
043 + *                                               043 + *
044 + * Copyright (c) 2000-2004 E. Marty, the boch    044 + * Copyright (c) 2000-2004 E. Marty, the bochs team, D.Decotigny
045 + *                                               045 + *
046 + * Permission is hereby granted, free of char    046 + * Permission is hereby granted, free of charge, to any person obtaining a copy
047 + * of this software and associated documentat    047 + * of this software and associated documentation files (the "Software"), to deal
048 + * in the Software without restriction, inclu    048 + * in the Software without restriction, including without limitation the rights
049 + * to use, copy, modify, merge, publish, dist    049 + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
050 + * copies of the Software, and to permit pers    050 + * copies of the Software, and to permit persons to whom the Software is
051 + * furnished to do so, subject to the followi    051 + * furnished to do so, subject to the following conditions:
052 + *                                               052 + *
053 + * The above copyright notice and this permis    053 + * The above copyright notice and this permission notice shall be included in
054 + * all copies or substantial portions of the     054 + * all copies or substantial portions of the Software.
055 + *                                               055 + *
056 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT     056 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
057 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE     057 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
058 + * FITNESS FOR A PARTICULAR PURPOSE AND NONIN    058 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
059 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE    059 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
060 + * LIABILITY, WHETHER IN AN ACTION OF CONTRAC    060 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
061 + * OUT OF OR IN CONNECTION WITH THE SOFTWARE     061 + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
062 + * THE SOFTWARE.                                 062 + * THE SOFTWARE.
063 + */                                              063 + */
064 +                                                 064 +
065 +#include <stdio.h>                               065 +#include <stdio.h>
066 +#include <unistd.h>                              066 +#include <unistd.h>
067 +#include <inttypes.h>                            067 +#include <inttypes.h>
068 +                                                 068 +
069 +#include "vl.h"                                  069 +#include "vl.h"
070 +                                                 070 +
071 +static void port_e9_write(void *opaque, uint3    071 +static void port_e9_write(void *opaque, uint32_t address, uint32_t data)
072 +{                                                072 +{
073 +       CharDriverState *chr;                     073 +       CharDriverState *chr;
074 +       chr = opaque;                             074 +       chr = opaque;
075 +                                                 075 +
076 +       qemu_chr_write(chr, & data, 1);           076 +       qemu_chr_write(chr, & data, 1);
077 +}                                                077 +}
078 +                                                 078 +
079 +static uint32_t port_e9_read(void *opaque, ui    079 +static uint32_t port_e9_read(void *opaque, uint32_t address)
080 +{                                                080 +{
081 +       return 0xE9;                              081 +       return 0xE9;
082 +}                                                082 +}
083 +                                                 083 +
084 +CharDriverState *port_e9_init (CharDriverStat    084 +CharDriverState *port_e9_init (CharDriverState *chr)
085 +{                                                085 +{
086 +       register_ioport_write(0xe9, 1, 1, port    086 +       register_ioport_write(0xe9, 1, 1, port_e9_write, chr);
087 +       register_ioport_read (0xe9, 1, 1, port    087 +       register_ioport_read (0xe9, 1, 1, port_e9_read,  chr);
088 +                                                 088 +
089 +       return chr;                               089 +       return chr;
090 +}                                                090 +}
091 +                                                 091 +
092 diff -urpNX /usr/kernel/dontdiff qemu-0.7.2/vl    092 diff -urpNX /usr/kernel/dontdiff qemu-0.7.2/vl.c qemu-0.7.2-clucas/vl.c
093 --- qemu-0.7.2/vl.c     2005-09-04 19:11:31.00    093 --- qemu-0.7.2/vl.c     2005-09-04 19:11:31.000000000 +0200
094 +++ qemu-0.7.2-clucas/vl.c      2005-09-14 11:    094 +++ qemu-0.7.2-clucas/vl.c      2005-09-14 11:24:51.000000000 +0200
095 @@ -146,6 +146,7 @@ int graphic_depth = 15;       095 @@ -146,6 +146,7 @@ int graphic_depth = 15;
096  int full_screen = 0;                             096  int full_screen = 0;
097  TextConsole *vga_console;                        097  TextConsole *vga_console;
098  CharDriverState *serial_hds[MAX_SERIAL_PORTS]    098  CharDriverState *serial_hds[MAX_SERIAL_PORTS];
099 +CharDriverState *port_e9_hds[MAX_PORT_E9_PORT    099 +CharDriverState *port_e9_hds[MAX_PORT_E9_PORTS];
100  CharDriverState *parallel_hds[MAX_PARALLEL_PO    100  CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
101  #ifdef TARGET_I386                               101  #ifdef TARGET_I386
102  int win2k_install_hack = 0;                      102  int win2k_install_hack = 0;
103 @@ -2969,6 +2970,7 @@ enum {                      103 @@ -2969,6 +2970,7 @@ enum {
104      QEMU_OPTION_monitor,                         104      QEMU_OPTION_monitor,
105      QEMU_OPTION_serial,                          105      QEMU_OPTION_serial,
106      QEMU_OPTION_parallel,                        106      QEMU_OPTION_parallel,
107 +    QEMU_OPTION_port_e9,                         107 +    QEMU_OPTION_port_e9,
108      QEMU_OPTION_loadvm,                          108      QEMU_OPTION_loadvm,
109      QEMU_OPTION_full_screen,                     109      QEMU_OPTION_full_screen,
110      QEMU_OPTION_pidfile,                         110      QEMU_OPTION_pidfile,
111 @@ -3040,6 +3042,7 @@ const QEMUOption qemu_op    111 @@ -3040,6 +3042,7 @@ const QEMUOption qemu_options[] = {
112      { "monitor", 1, QEMU_OPTION_monitor },       112      { "monitor", 1, QEMU_OPTION_monitor },
113      { "serial", 1, QEMU_OPTION_serial },         113      { "serial", 1, QEMU_OPTION_serial },
114      { "parallel", 1, QEMU_OPTION_parallel },     114      { "parallel", 1, QEMU_OPTION_parallel },
115 +    { "port-e9", 1, QEMU_OPTION_port_e9 },       115 +    { "port-e9", 1, QEMU_OPTION_port_e9 },
116      { "loadvm", HAS_ARG, QEMU_OPTION_loadvm }    116      { "loadvm", HAS_ARG, QEMU_OPTION_loadvm },
117      { "full-screen", 0, QEMU_OPTION_full_scre    117      { "full-screen", 0, QEMU_OPTION_full_screen },
118      { "pidfile", HAS_ARG, QEMU_OPTION_pidfile    118      { "pidfile", HAS_ARG, QEMU_OPTION_pidfile },
119 @@ -3143,6 +3146,8 @@ int main(int argc, char     119 @@ -3143,6 +3146,8 @@ int main(int argc, char **argv)
120      char monitor_device[128];                    120      char monitor_device[128];
121      char serial_devices[MAX_SERIAL_PORTS][128    121      char serial_devices[MAX_SERIAL_PORTS][128];
122      int serial_device_index;                     122      int serial_device_index;
123 +    char port_e9_devices[MAX_PORT_E9_PORTS][1    123 +    char port_e9_devices[MAX_PORT_E9_PORTS][128];
124 +    int port_e9_device_index;                    124 +    int port_e9_device_index;
125      char parallel_devices[MAX_PARALLEL_PORTS]    125      char parallel_devices[MAX_PARALLEL_PORTS][128];
126      int parallel_device_index;                   126      int parallel_device_index;
127      const char *loadvm = NULL;                   127      const char *loadvm = NULL;
128 @@ -3184,12 +3189,17 @@ int main(int argc, cha    128 @@ -3184,12 +3189,17 @@ int main(int argc, char **argv)
129      for(i = 1; i < MAX_SERIAL_PORTS; i++)        129      for(i = 1; i < MAX_SERIAL_PORTS; i++)
130          serial_devices[i][0] = '\0';             130          serial_devices[i][0] = '\0';
131      serial_device_index = 0;                     131      serial_device_index = 0;
132 -                                                 132 -    
133 +                                                 133 +
134      pstrcpy(parallel_devices[0], sizeof(paral    134      pstrcpy(parallel_devices[0], sizeof(parallel_devices[0]), "vc");
135      for(i = 1; i < MAX_PARALLEL_PORTS; i++)      135      for(i = 1; i < MAX_PARALLEL_PORTS; i++)
136          parallel_devices[i][0] = '\0';           136          parallel_devices[i][0] = '\0';
137      parallel_device_index = 0;                   137      parallel_device_index = 0;
138 -                                                 138 -    
139 +                                                 139 +
140 +       pstrcpy(port_e9_devices[0], sizeof(por    140 +       pstrcpy(port_e9_devices[0], sizeof(port_e9_devices[0]), "vc");
141 +       for(i = 1; i < MAX_PORT_E9_PORTS; i++)    141 +       for(i = 1; i < MAX_PORT_E9_PORTS; i++)
142 +               port_e9_devices[i][0] = '\0';     142 +               port_e9_devices[i][0] = '\0';
143 +       port_e9_device_index = 0;                 143 +       port_e9_device_index = 0;
144 +                                                 144 +
145      nb_tun_fds = 0;                              145      nb_tun_fds = 0;
146      net_if_type = -1;                            146      net_if_type = -1;
147      nb_nics = 1;                                 147      nb_nics = 1;
148 @@ -3526,6 +3536,15 @@ int main(int argc, char    148 @@ -3526,6 +3536,15 @@ int main(int argc, char **argv)
149                          sizeof(parallel_devic    149                          sizeof(parallel_devices[0]), optarg);
150                  parallel_device_index++;         150                  parallel_device_index++;
151                  break;                           151                  break;
152 +                       case QEMU_OPTION_port_    152 +                       case QEMU_OPTION_port_e9:
153 +                               if (port_e9_de    153 +                               if (port_e9_device_index >= MAX_PORT_E9_PORTS) {
154 +                                       fprint    154 +                                       fprintf(stderr, "qemu: too many port e9 ports\n");
155 +                                       exit(1    155 +                                       exit(1);
156 +                               }                 156 +                               }
157 +                               pstrcpy(port_e    157 +                               pstrcpy(port_e9_devices[port_e9_device_index],
158 +                                                 158 +                                                       sizeof(port_e9_devices[0]), optarg);
159 +                               port_e9_device    159 +                               port_e9_device_index++;
160 +                               break;            160 +                               break;
161             case QEMU_OPTION_loadvm:              161             case QEMU_OPTION_loadvm:
162                 loadvm = optarg;                  162                 loadvm = optarg;
163                 break;                            163                 break;
164 @@ -3771,6 +3790,19 @@ int main(int argc, char    164 @@ -3771,6 +3790,19 @@ int main(int argc, char **argv)
165          }                                        165          }
166      }                                            166      }
167                                                   167  
168 +       for (i=0 ; i<MAX_PORT_E9_PORTS ; i++)     168 +       for (i=0 ; i<MAX_PORT_E9_PORTS ; i++) {
169 +               if (port_e9_devices[i][0] != '    169 +               if (port_e9_devices[i][0] != '\0') {
170 +                       port_e9_hds[i] = qemu_    170 +                       port_e9_hds[i] = qemu_chr_open(port_e9_devices[i]);
171 +                       if (!port_e9_hds[i]) {    171 +                       if (!port_e9_hds[i]) {
172 +                               fprintf(stderr    172 +                               fprintf(stderr, "qemu: could not open port e9 device '%s'\n", 
173 +                                                 173 +                                                                                               port_e9_devices[i]);
174 +                               exit(1);          174 +                               exit(1);
175 +                       }                         175 +                       }
176 +                       if (!strcmp(port_e9_de    176 +                       if (!strcmp(port_e9_devices[i], "vc"))
177 +                               qemu_chr_print    177 +                               qemu_chr_printf(port_e9_hds[i], "port_e9_%d console\n", i);
178 +               }                                 178 +               }
179 +       }                                         179 +       }
180 +                                                 180 +
181      /* setup cpu signal handlers for MMU / se    181      /* setup cpu signal handlers for MMU / self modifying code handling */
182  #if !defined(CONFIG_SOFTMMU)                     182  #if !defined(CONFIG_SOFTMMU)
183                                                   183      
184 diff -urpNX /usr/kernel/dontdiff qemu-0.7.2/vl    184 diff -urpNX /usr/kernel/dontdiff qemu-0.7.2/vl.h qemu-0.7.2-clucas/vl.h
185 --- qemu-0.7.2/vl.h     2005-09-04 19:11:31.00    185 --- qemu-0.7.2/vl.h     2005-09-04 19:11:31.000000000 +0200
186 +++ qemu-0.7.2-clucas/vl.h      2005-09-14 11:    186 +++ qemu-0.7.2-clucas/vl.h      2005-09-14 11:24:51.000000000 +0200
187 @@ -242,6 +242,15 @@ extern CharDriverState *s    187 @@ -242,6 +242,15 @@ extern CharDriverState *serial_hds[MAX_S
188                                                   188  
189  extern CharDriverState *parallel_hds[MAX_PARA    189  extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
190                                                   190  
191 +/* port E9 ports */                              191 +/* port E9 ports */
192 +#define MAX_PORT_E9_PORTS 1                      192 +#define MAX_PORT_E9_PORTS 1
193 +                                                 193 +
194 +#if (MAX_PORT_E9_PORTS != 1)                     194 +#if (MAX_PORT_E9_PORTS != 1)
195 + #error "No more than one port E9 is supporte    195 + #error "No more than one port E9 is supported"
196 +#endif                                           196 +#endif
197 +                                                 197 +
198 +extern CharDriverState *port_e9_hds[MAX_PORT_    198 +extern CharDriverState *port_e9_hds[MAX_PORT_E9_PORTS];
199 +                                                 199 +
200  /* network redirectors support */                200  /* network redirectors support */
201                                                   201  
202  #define MAX_NICS 8                               202  #define MAX_NICS 8
203 @@ -688,6 +697,9 @@ SerialState *serial_init(i    203 @@ -688,6 +697,9 @@ SerialState *serial_init(int base, int i
204  typedef struct ParallelState ParallelState;      204  typedef struct ParallelState ParallelState;
205  ParallelState *parallel_init(int base, int ir    205  ParallelState *parallel_init(int base, int irq, CharDriverState *chr);
206                                                   206  
207 +/* port-e9.c */                                  207 +/* port-e9.c */
208 +CharDriverState *port_e9_init(CharDriverState    208 +CharDriverState *port_e9_init(CharDriverState *chr);
209 +                                                 209 +
210  /* i8259.c */                                    210  /* i8259.c */
211                                                   211  
212  typedef struct PicState2 PicState2;              212  typedef struct PicState2 PicState2;
                                                      

source navigation ] diff markup ] identifier search ] general search ]