diff --git a/repos/dde_bsd/audio.list b/repos/dde_bsd/audio.list index ae457ecf8..5bbe5023d 100644 --- a/repos/dde_bsd/audio.list +++ b/repos/dde_bsd/audio.list @@ -7,8 +7,6 @@ ./sys/dev/pci/eapreg.h ./sys/dev/pci/pcidevs.h ./sys/dev/pci/pcidevs_data.h -./sys/dev/auconv.c -./sys/dev/auconv.h ./sys/dev/mulaw.c ./sys/dev/mulaw.h ./sys/dev/ic/ac97.c diff --git a/repos/dde_bsd/include/audio/audio.h b/repos/dde_bsd/include/audio/audio.h index f9236db40..faccd7642 100644 --- a/repos/dde_bsd/include/audio/audio.h +++ b/repos/dde_bsd/include/audio/audio.h @@ -9,7 +9,7 @@ */ /* - * Copyright (C) 2014 Genode Labs GmbH + * Copyright (C) 2016 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. @@ -18,7 +18,10 @@ #ifndef _AUDIO__AUDIO_H_ #define _AUDIO__AUDIO_H_ -#include +/* Genode includes */ +#include +#include + /***************************** ** private Audio namespace ** @@ -38,7 +41,9 @@ namespace Audio_in { namespace Audio { - void init_driver(Server::Entrypoint &ep); + void update_config(Genode::Xml_node); + + void init_driver(Genode::Env &, Genode::Allocator &, Genode::Xml_node); bool driver_active(); diff --git a/repos/dde_bsd/lib/import/import-dde_bsd_audio_include.mk b/repos/dde_bsd/lib/import/import-dde_bsd_audio_include.mk new file mode 100644 index 000000000..6f0ca5a20 --- /dev/null +++ b/repos/dde_bsd/lib/import/import-dde_bsd_audio_include.mk @@ -0,0 +1 @@ +INC_DIR += $(LIB_CACHE_DIR)/dde_bsd_audio_include/include diff --git a/repos/dde_bsd/lib/mk/dde_bsd_audio.inc b/repos/dde_bsd/lib/mk/dde_bsd_audio.inc index fe9e966c1..4543c83a3 100644 --- a/repos/dde_bsd/lib/mk/dde_bsd_audio.inc +++ b/repos/dde_bsd/lib/mk/dde_bsd_audio.inc @@ -3,10 +3,16 @@ LIB_INC_DIR = $(LIB_DIR)/include AUDIO_CONTRIB_DIR := $(call select_from_ports,dde_bsd)/src/lib/audio +# +# Set include paths up before adding the dde_bsd_audio_include library +# because it will use INC_DIR += and must be at the end +# INC_DIR += $(LIB_DIR) INC_DIR += $(LIB_INC_DIR) INC_DIR += $(AUDIO_CONTRIB_DIR) +LIBS += dde_bsd_audio_include + SRC_CC += bus.cc dummies.cc driver.cc irq.cc mem.cc misc.cc scheduler.cc timer.cc SRC_C += bsd_emul.c SRC_S += setjmp.S @@ -19,13 +25,16 @@ CC_OPT += -fno-builtin-printf -fno-builtin-snprintf -fno-builtin-vsnprintf \ CC_OPT += -D_KERNEL +# disable false warning in audio.c:786 +CC_C_OPT += -Wno-maybe-uninitialized + # enable when debugging # CC_OPT += -DAUDIO_DEBUG # CC_OPT += -DAZALIA_DEBUG # CC_OPT += -DDIAGNOSTIC # audio interface -SRC_C += dev/audio.c dev/auconv.c +SRC_C += dev/audio.c # AC97 codec SRC_C += dev/ic/ac97.c @@ -38,38 +47,6 @@ SRC_C += dev/pci/eap.c SRC_C += dev/mulaw.c -# -# Determine the header files included by the contrib code. For each -# of these header files we create a symlink to 'bsd_emul.h'. -# -GEN_INCLUDES := $(shell grep -rh "^\#include .*" $(AUDIO_CONTRIB_DIR) |\ - sed "s/^\#include [^<\"]*[<\"]\([^>\"]*\)[>\"].*/\1/" | sort | uniq) - -# -# Filter out original BSD headers that exist in the contrib directory -# -NO_GEN_INCLUDES := $(shell cd $(AUDIO_CONTRIB_DIR); find -name "*.h" | sed "s/.\///" | sed "s/.*include\///") -GEN_INCLUDES := $(filter-out $(NO_GEN_INCLUDES),$(GEN_INCLUDES)) - -# -# Put BSD headers in 'GEN_INC' dir -# -GEN_INC := $(shell pwd)/include - -$(shell mkdir -p $(GEN_INC)) - -GEN_INCLUDES := $(addprefix $(GEN_INC)/,$(GEN_INCLUDES)) -INC_DIR += $(GEN_INC) - -# -# Make sure to create the header symlinks prior building -# -$(SRC_C:.c=.o) $(SRC_CC:.cc=.o): $(GEN_INCLUDES) - -$(GEN_INCLUDES): - $(VERBOSE)mkdir -p $(dir $@) - $(VERBOSE)ln -s $(LIB_INC_DIR)/bsd_emul.h $@ - vpath %.c $(AUDIO_CONTRIB_DIR) vpath %.c $(LIB_DIR) vpath %.cc $(LIB_DIR) diff --git a/repos/dde_bsd/lib/mk/dde_bsd_audio_include.mk b/repos/dde_bsd/lib/mk/dde_bsd_audio_include.mk new file mode 100644 index 000000000..874249e4c --- /dev/null +++ b/repos/dde_bsd/lib/mk/dde_bsd_audio_include.mk @@ -0,0 +1,24 @@ +# +# Pseudo library to generate a symlink for each header file included by the +# contrib code. Each symlink points to the same 'bsd_emul.h' file, which +# provides our emulation of the OpenBSD kernel API. +# + +ifeq ($(called_from_lib_mk),yes) + +BSD_CONTRIB_DIR := $(call select_from_ports,dde_bsd)/src/lib/audio +BSD_EMUL_H := $(REP_DIR)/src/lib/audio/include/bsd_emul.h + +GEN_INCLUDES := $(shell grep -rh "^\#include .*" $(BSD_CONTRIB_DIR) |\ + sed "s/^\#include [^<\"]*[<\"]\([^>\"]*\)[>\"].*/\1/" | sort | uniq) + +GEN_INC := $(shell pwd)/include +GEN_INCLUDES := $(addprefix $(GEN_INC)/,$(GEN_INCLUDES)) + +all: $(GEN_INCLUDES) + +$(GEN_INCLUDES): + $(VERBOSE)mkdir -p $(dir $@) + $(VERBOSE)ln -sf $(BSD_EMUL_H) $@ + +endif diff --git a/repos/dde_bsd/patches/notify.patch b/repos/dde_bsd/patches/notify.patch index c8f3a7923..fa15ae5e6 100644 --- a/repos/dde_bsd/patches/notify.patch +++ b/repos/dde_bsd/patches/notify.patch @@ -1,17 +1,19 @@ +diff --git a/dev/audio.c b/dev/audio.c +index 1271bc7..6535d10 100644 --- a/dev/audio.c +++ b/dev/audio.c -@@ -2293,6 +2293,8 @@ - sc->sc_pqui = 1; - audio_wake(&sc->sc_wchan); +@@ -411,6 +411,8 @@ audio_pintr(void *addr) + } + selwakeup(&sc->play.sel); } + + notify_play(); } /* -@@ -2400,6 +2402,8 @@ - sc->sc_rqui = 1; - audio_wake(&sc->sc_rchan); +@@ -486,6 +488,8 @@ audio_rintr(void *addr) + } + selwakeup(&sc->rec.sel); } + + notify_record(); diff --git a/repos/dde_bsd/ports/dde_bsd.hash b/repos/dde_bsd/ports/dde_bsd.hash index c8119c5ef..e942fe04e 100644 --- a/repos/dde_bsd/ports/dde_bsd.hash +++ b/repos/dde_bsd/ports/dde_bsd.hash @@ -1 +1 @@ -7efb09a93f78f7896e1a73264145e188afa3e80f +9d32d78a9e2488f993723b6d1d353dec2bc55e24 diff --git a/repos/dde_bsd/ports/dde_bsd.port b/repos/dde_bsd/ports/dde_bsd.port index dbfdf25ad..896817af4 100644 --- a/repos/dde_bsd/ports/dde_bsd.port +++ b/repos/dde_bsd/ports/dde_bsd.port @@ -3,12 +3,12 @@ VERSION := 1 DOWNLOADS := audio.archive # -# Audio drivers from OpenBSD 5.7 +# Audio drivers from OpenBSD 5.9 # SRC_DIR_AUDIO := src/lib/audio -VERSION_AUDIO := 5.7 +VERSION_AUDIO := 5.9 URL(audio) := http://mirror.switch.ch/ftp/pub/OpenBSD/$(VERSION_AUDIO)/sys.tar.gz -SHA(audio) := 1a60125a7fce6524b0d62643db47acca0b11506a +SHA(audio) := 65080ae5524ffed903dac7ecb49c1c4955afbc7f DIR(audio) := $(SRC_DIR_AUDIO) TAR_OPT(audio) := --strip-components=2 --files-from $(REP_DIR)/audio.list HASH_INPUT += $(REP_DIR)/audio.list diff --git a/repos/dde_bsd/run/audio_out.run b/repos/dde_bsd/run/audio_out.run index 8357bacab..2d4212f58 100644 --- a/repos/dde_bsd/run/audio_out.run +++ b/repos/dde_bsd/run/audio_out.run @@ -72,9 +72,7 @@ append_if $use_mixer config { append config { - - - + diff --git a/repos/dde_bsd/src/drivers/audio/main.cc b/repos/dde_bsd/src/drivers/audio/main.cc index ae38d3b16..5c9457661 100644 --- a/repos/dde_bsd/src/drivers/audio/main.cc +++ b/repos/dde_bsd/src/drivers/audio/main.cc @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2014-2015 Genode Labs GmbH + * Copyright (C) 2014-2016 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. @@ -15,21 +15,16 @@ /* Genode includes */ #include #include -#include -#include -#include -#include -#include +#include +#include +#include #include -#include -#include /* local includes */ #include