Skip to contentSkip to conversation

[4173] Braille device support

Qemu-devel Aurelien Jarno 1 participant 1 message Apr 8, 2008 Kbuild

lore
Share & tools
lore
#0 lore raw

Revision: 4173

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4173
Author:   aurel32
Date:     2008-04-08 06:01:02 +0000 (Tue, 08 Apr 2008)

Log Message:
-----------
Braille device support

(Samuel Thibault)

Modified Paths:
--------------
trunk/Makefile
trunk/Makefile.target
trunk/configure
trunk/qemu-doc.texi
trunk/vl.c

Added Paths:
-----------
trunk/hw/baum.c
trunk/hw/baum.h

Modified: trunk/Makefile
===================================================================

Makefile +5 -0
@@ -57,6 +57,11 @@
 OBJS+=usb.o usb-hub.o usb-linux.o usb-hid.o usb-msd.o usb-wacom.o usb-serial.o
 OBJS+=sd.o ssi-sd.o
 
+ifdef CONFIG_BRLAPI
+OBJS+= baum.o
+LIBS+=-lbrlapi
+endif
+
 ifdef CONFIG_WIN32
 OBJS+=tap-win32.o
 endif

Modified: trunk/Makefile.target
===================================================================

Makefile.target +1 -1
@@ -658,7 +658,7 @@
 endif
 
 $(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a
-	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS)
+	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS)
 
 endif # !CONFIG_USER_ONLY
 

Modified: trunk/configure
===================================================================

configure +23 -0
@@ -286,6 +286,8 @@
   ;;
   --disable-kqemu) kqemu="no"
   ;;
+  --disable-brlapi) brlapi="no"
+  ;;
   --enable-profiler) profiler="yes"
   ;;
   --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no"
@@ -416,6 +418,7 @@
 echo "  --enable-esd             enable EsoundD audio driver"
 echo "  --enable-fmod            enable FMOD audio driver"
 echo "  --enable-dsound          enable DirectSound audio driver"
+echo "  --disable-brlapi         disable BrlAPI"
 echo "  --disable-vnc-tls        disable TLS encryption for VNC server"
 echo "  --disable-curses         disable curses output"
 echo "  --enable-system          enable all system emulation targets"
@@ -674,6 +677,20 @@
 fi
 
 ##########################################
+# BrlAPI probe
+
+if test -z "$brlapi" ; then
+    brlapi=no
+cat > $TMPC << EOF
+#include <brlapi.h>
+int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
+EOF
+    if $cc -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi 2> /tmp/qemu-$$-brlapi.log ; then
+	    brlapi=yes
+    fi # brlapi compile test
+fi # -z $brlapi
+
+##########################################
 # curses probe
 
 if test "$curses" = "yes" ; then
@@ -770,6 +787,7 @@
     echo "Target Sparc Arch $sparc_cpu"
 fi
 echo "kqemu support     $kqemu"
+echo "brlapi support    $brlapi"
 echo "Documentation     $build_docs"
 [ ! -z "$uname_release" ] && \
 echo "uname -r          $uname_release"
@@ -1001,6 +1019,11 @@
   echo "CONFIG_CURSES=yes" >> $config_mak
   echo "CURSES_LIBS=-lcurses" >> $config_mak
 fi
+if test "$brlapi" = "yes" ; then
+  echo "CONFIG_BRLAPI=yes" >> $config_mak
+  echo "#define CONFIG_BRLAPI 1" >> $config_h
+  echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
+fi
 
 # XXX: suppress that
 if [ "$bsd" = "yes" ] ; then

Added: trunk/hw/baum.c
===================================================================

hw/baum.c +643 -0

643 lines not on this page · raw message

Added: trunk/hw/baum.h
===================================================================

hw/baum.h +29 -0
@@ -0,0 +1,29 @@
+/*
+ * QEMU Baum
+ *
+ * Copyright (c) 2008 Samuel Thibault
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/* usb device */
+USBDevice *usb_baum_init(void);
+
+/* char device */
+CharDriverState *chr_baum_init(void);

Modified: trunk/qemu-doc.texi
===================================================================
(Binary files differ)

Modified: trunk/vl.c
===================================================================

vl.c +11 -1
@@ -28,6 +28,7 @@
 #include "hw/pc.h"
 #include "hw/audiodev.h"
 #include "hw/isa.h"
+#include "hw/baum.h"
 #include "net.h"
 #include "console.h"
 #include "sysemu.h"
@@ -3473,8 +3474,13 @@
     } else
     if (strstart(filename, "file:", &p)) {
         return qemu_chr_open_win_file_out(p);
-    }
+    } else
 #endif
+#ifdef CONFIG_BRLAPI
+    if (!strcmp(filename, "braille")) {
+        return chr_baum_init();
+    } else
+#endif
     {
         return NULL;
     }
@@ -5281,6 +5287,10 @@
         dev = usb_wacom_init();
     } else if (strstart(devname, "serial:", &p)) {
         dev = usb_serial_init(p);
+#ifdef CONFIG_BRLAPI
+    } else if (!strcmp(devname, "braille")) {
+        dev = usb_baum_init();
+#endif
     } else {
         return -1;
     }