Changeset 6eb957dc in mainline
- Timestamp:
- 2014-10-09T03:34:21Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ef3da5a
- Parents:
- fa65df1 (diff), 18cc83c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 82 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
.bzrignore
rfa65df1 r6eb957dc 2 2 *.map 3 3 *.prev 4 *.ag.probe.[cs] 4 5 Makefile.depend 5 6 Makefile.common … … 20 21 kernel/generic/src/debug/real_map.bin 21 22 uspace/app/bdsh/bdsh 23 uspace/app/bdsh/test-bdsh 22 24 uspace/app/bithenge/bithenge 23 25 uspace/app/blkdump/blkdump … … 183 185 uspace/dist/srv/udf 184 186 uspace/dist/srv/udp 187 uspace/dist/test/* 185 188 uspace/drv/audio/hdaudio/hdaudio 186 189 uspace/drv/audio/sb16/sb16 … … 220 223 uspace/lib/c/arch/amd64/_link.ld 221 224 uspace/lib/c/arch/amd64/include/libarch/common.h 225 uspace/lib/c/test-libc 226 uspace/lib/pcut/test-libpcut-* 222 227 uspace/lib/posix/collisions.list 223 228 uspace/lib/posix/redefs-hide-libc.xargs 224 229 uspace/lib/posix/redefs-show-posix.xargs 225 230 uspace/lib/posix/include/libc 231 uspace/lib/posix/test-libposix 232 uspace/lib/uri/test-liburi 226 233 uspace/srv/audio/hound/hound 227 234 uspace/srv/bd/file_bd/file_bd … … 295 302 uspace/srv/klog/klog 296 303 uspace/dist/srv/klog 304 kernel/arch/sparc64/include/arch/context_struct.h 305 kernel/arch/sparc64/include/arch/istate_struct.h 306 kernel/arch/amd64/include/arch/context_struct.h 307 kernel/arch/amd64/include/arch/istate_struct.h 308 kernel/arch/ia32/include/arch/context_struct.h 309 kernel/arch/ia32/include/arch/istate_struct.h 310 kernel/arch/ppc32/include/arch/context_struct.h 311 kernel/arch/ppc32/include/arch/fpu_context_struct.h 312 kernel/arch/ppc32/include/arch/istate_struct.h 313 kernel/arch/arm32/include/arch/context_struct.h 314 kernel/arch/arm32/include/arch/istate_struct.h 315 kernel/arch/mips32/include/arch/context_struct.h 316 kernel/arch/mips32/include/arch/fpu_context_struct.h 317 kernel/arch/mips32/include/arch/istate_struct.h 318 kernel/arch/ia64/include/arch/context_struct.h 319 kernel/arch/ia64/include/arch/istate_struct.h 320 uspace/lib/c/arch/sparc64/include/libarch/fibril_context.h 321 uspace/lib/c/arch/sparc64/include/libarch/istate_struct.h 322 uspace/lib/c/arch/amd64/include/libarch/fibril_context.h 323 uspace/lib/c/arch/amd64/include/libarch/istate_struct.h 324 uspace/lib/c/arch/ia32/include/libarch/fibril_context.h 325 uspace/lib/c/arch/ia32/include/libarch/istate_struct.h 326 uspace/lib/c/arch/ppc32/include/libarch/fibril_context.h 327 uspace/lib/c/arch/ppc32/include/libarch/istate_struct.h 328 uspace/lib/c/arch/arm32/include/libarch/fibril_context.h 329 uspace/lib/c/arch/arm32/include/libarch/istate_struct.h 330 uspace/lib/c/arch/mips32eb/include/libarch/fibril_context.h 331 uspace/lib/c/arch/mips32eb/include/libarch/istate_struct.h 332 uspace/lib/c/arch/mips32/include/libarch/fibril_context.h 333 uspace/lib/c/arch/mips32/include/libarch/istate_struct.h 334 uspace/lib/c/arch/ia64/include/libarch/fibril_context.h 335 uspace/lib/c/arch/ia64/include/libarch/istate_struct.h -
HelenOS.config
rfa65df1 r6eb957dc 600 600 ! CONFIG_WRITE_CORE_FILES (n/y) 601 601 602 % Include userspace unit tests (PCUT) 603 ! CONFIG_PCUT_TESTS (n/y) 604 605 % Include PCUT self-tests 606 ! CONFIG_PCUT_SELF_TESTS (n/y) 607 602 608 % Include development files (headers, libraries) 603 609 ! CONFIG_DEVEL_FILES (n/y) -
boot/Makefile
rfa65df1 r6eb957dc 68 68 cp "$$file" "$(DIST_PATH)/app/" ; \ 69 69 done 70 ifeq ($(CONFIG_PCUT_TESTS),y) 71 echo "echo Running all tests..." >"$(DIST_PATH)/test/run_all" 72 echo "<html><head><title>HelenOS test results</title></head><body>" >"$(DIST_PATH)/test/test.html" 73 echo "<h1>HelenOS test results</h1><ul>" >>"$(DIST_PATH)/test/test.html" 74 for file in $(RD_TESTS) ; do \ 75 file2=`basename $$file`; \ 76 cp "$$file" "$(DIST_PATH)/test/" ; \ 77 echo "echo ' ->' $$file2" >>"$(DIST_PATH)/test/run_all"; \ 78 echo "/test/$$file2 | to /test/$$file2.out" >>"$(DIST_PATH)/test/run_all"; \ 79 echo "cat /test/$$file2.out" >>"$(DIST_PATH)/test/run_all"; \ 80 echo "cp -f /test/$$file2.out /data/web/result-$$file2.txt" >>"$(DIST_PATH)/test/run_all"; \ 81 echo "<li><a href=\"result-$$file2.txt\">$$file2</a></li>" >>"$(DIST_PATH)/test/test.html"; \ 82 done 83 echo "cp -f /test/test.html /data/web/test.html" >>"$(DIST_PATH)/test/run_all" 84 echo "</ul></body></html>" >>"$(DIST_PATH)/test/test.html" 85 endif 86 87 ifeq ($(CONFIG_PCUT_SELF_TESTS),y) 88 echo "echo Running all PCUT self-tests..." >"$(DIST_PATH)/test/run_pcut" 89 echo "<html><head><title>Results of PCUT self-tests on HelenOS</title></head><body>" >"$(DIST_PATH)/test/pcut.html" 90 echo "<h1>Results of PCUT self-tests on HelenOS</h1><ul>" >>"$(DIST_PATH)/test/pcut.html" 91 for file in $(USPACE_PATH)/lib/pcut/test-libpcut-*; do \ 92 file2=`basename $$file`; \ 93 name=`echo "$$file2" | sed 's/test-libpcut-//'`; \ 94 cp "$$file" "$(DIST_PATH)/test/" ; \ 95 echo "echo ' ->' $$name" >>"$(DIST_PATH)/test/run_pcut"; \ 96 echo "/test/$$file2 | to /test/$$file2.out" >>"$(DIST_PATH)/test/run_pcut"; \ 97 echo "cat /test/$$file2.out" >>"$(DIST_PATH)/test/run_pcut"; \ 98 echo "cp -f /test/$$file2.out /data/web/result-$$file2.txt" >>"$(DIST_PATH)/test/run_pcut"; \ 99 echo "<li><a href=\"result-$$file2.txt\">$$name</a></li>" >>"$(DIST_PATH)/test/pcut.html"; \ 100 done 101 echo "cp -f /test/pcut.html /data/web/pcut.html" >>"$(DIST_PATH)/test/run_pcut" 102 echo "</ul></body></html>" >>"$(DIST_PATH)/test/pcut.html" 103 endif 104 70 105 for drv in $(RD_DRVS) ; do \ 71 106 drv_dir="`dirname "$$drv"`" ; \ … … 100 135 rm -rf $(USPACE_PATH)/dist/inc/* 101 136 rm -f $(USPACE_PATH)/dist/app/* 137 rm -f $(USPACE_PATH)/dist/test/* 102 138 rm -f $(USPACE_PATH)/dist/cfg/net/* -
boot/Makefile.common
rfa65df1 r6eb957dc 186 186 $(USPACE_PATH)/app/loc/loc \ 187 187 $(USPACE_PATH)/app/mixerctl/mixerctl \ 188 $(USPACE_PATH)/app/modplay/modplay \ 188 189 $(USPACE_PATH)/app/logset/logset \ 189 190 $(USPACE_PATH)/app/mkfat/mkfat \ … … 221 222 $(USPACE_PATH)/app/fontviewer/fontviewer 222 223 224 RD_TESTS = \ 225 $(USPACE_PATH)/lib/c/test-libc \ 226 $(USPACE_PATH)/lib/posix/test-libposix \ 227 $(USPACE_PATH)/lib/uri/test-liburi \ 228 $(USPACE_PATH)/app/bdsh/test-bdsh 229 230 223 231 COMPONENTS = \ 224 232 $(KERNEL_PATH)/kernel.bin \ -
contrib/qfs/qfs.sh
rfa65df1 r6eb957dc 1 #!/usr/bin/bash 1 #!/bin/bash 2 2 3 # 3 # Copyright (c) 2014 Jakub Jermar 4 # Copyright (c) 2014 Jakub Jermar 4 5 # All rights reserved. 5 6 # … … 30 31 VERSION=2.1.1 31 32 BASENAME=qemu-${VERSION} 33 BASENAME_MASTER=qemu-master 32 34 TARBALL=${BASENAME}.tar.bz2 33 35 SOURCEDIR=${BASENAME} 34 36 URL=http://wiki.qemu-project.org/download/${TARBALL} 37 REPO=git://git.qemu.org/qemu.git 35 38 MD5="78b1b51bfa2eee424e1bfdf3b66daa64" 36 39 37 if [ ! -f ${TARBALL} ]; 38 then 39 wget ${URL} 40 if [ "$1" == "--master" ]; then 41 git clone ${REPO} ${BASENAME_MASTER} 42 cd ${BASENAME_MASTER} 43 else 44 if [ ! -f ${TARBALL} ]; then 45 wget ${URL} 46 fi 47 48 if [ "`md5sum ${TARBALL} | cut -f 1 -d " "`" != ${MD5} ]; then 49 echo Wrong MD5 checksum 50 exit 51 fi 52 53 tar xvfj ${TARBALL} 54 cd ${SOURCEDIR} 40 55 fi 41 56 42 if [ `md5sum ${TARBALL} | cut -f 1 -d " "` != ${MD5} ];43 then44 echo Wrong MD5 checksum45 exit46 fi47 48 tar xvfj ${TARBALL}49 50 cd ${SOURCEDIR}51 52 57 ./configure --target-list=i386-softmmu,x86_64-softmmu,arm-softmmu,ppc-softmmu,sparc-softmmu,sparc64-softmmu,mips-softmmu,mipsel-softmmu --audio-drv-list=pa 53 54 58 make -j 4 55 56 59 sudo make install 57 -
uspace/Makefile
rfa65df1 r6eb957dc 58 58 app/mkexfat \ 59 59 app/mkmfs \ 60 app/modplay \ 60 61 app/nterm \ 61 62 app/redir \ … … 223 224 lib/nic \ 224 225 lib/ext4 \ 226 lib/trackmod \ 225 227 lib/uri \ 226 228 lib/usb \ … … 230 232 lib/usbvirt \ 231 233 lib/pcm \ 234 lib/pcut \ 232 235 lib/bithenge \ 233 236 lib/posix \ … … 239 242 LIBN_BUILD = $(addsuffix .build,$(LIBN)) 240 243 BUILDS := $(addsuffix .build,$(DIRS)) 244 BUILDS_TESTS := $(addsuffix .build-test,$(DIRS) $(LIBS) lib/c) 241 245 242 246 CLEANS := $(addsuffix .clean,$(DIRS)) $(addsuffix .clean,$(LIBN)) $(addsuffix .clean,$(LIBS)) $(addsuffix .clean,$(LIBC)) … … 244 248 .PHONY: all $(LIBC_BUILD) $(LIBS_BUILD) $(LIBN_BUILD) $(BUILDS) $(CLEANS) clean 245 249 246 all: $(BUILDS) 250 all: $(BUILDS) $(BUILDS_TESTS) 251 252 $(BUILDS_TESTS): $(BUILDS) 253 $(MAKE) -C $(basename $@) all-test PRECHECK=$(PRECHECK) 247 254 248 255 clean: $(CLEANS) -
uspace/Makefile.common
rfa65df1 r6eb957dc 78 78 JOB = $(BINARY).job 79 79 OUTPUT = $(BINARY) 80 TEST_BINARY = test-$(BINARY) 80 81 EXTRA_OUTPUT += $(BINARY).disasm 81 82 EXTRA_CLEAN += $(BINARY).map … … 85 86 JOB = $(LIBRARY).job 86 87 OUTPUT = $(LIBRARY).a 88 TEST_BINARY = test-$(LIBRARY) 87 89 endif 88 90 … … 144 146 145 147 LIBSCSI_PREFIX = $(LIB_PREFIX)/scsi 148 LIBTRACKMOD_PREFIX = $(LIB_PREFIX)/trackmod 146 149 147 150 LIBBITHENGE_PREFIX = $(LIB_PREFIX)/bithenge … … 200 203 endif 201 204 205 # PCUT-based unit tests 206 ifneq ($(TEST_SOURCES),) 207 TEST_OUTPUT = $(TEST_BINARY) 208 TEST_CFLAGS = -I$(LIB_PREFIX)/pcut/include -D__helenos__ 209 TEST_OUTPUT_LIBS = $(LIB_PREFIX)/pcut/libpcut.a 210 EXTRA_CLEAN += $(TEST_OUTPUT) $(TEST_OUTPUT).map 211 ifneq ($(LIBRARY),) 212 TEST_OUTPUT_LIBS += $(OUTPUT) 213 endif 214 TEST_OUTPUT_LIBS += $(TEST_LIBS) 215 endif 216 202 217 .PHONY: all clean 203 218 204 219 all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(LIBS) $(OUTPUT) $(LOUTPUT) $(EXTRA_OUTPUT) 205 220 -[ -f $(DEPEND) ] && cp -a $(DEPEND) $(DEPEND_PREV) 221 222 all-test: $(TEST_OUTPUT) 206 223 207 224 clean: … … 294 311 OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) 295 312 LOBJECTS := $(addsuffix .lo,$(basename $(SOURCES))) 313 TEST_OBJECTS := $(addsuffix .test.o,$(basename $(TEST_SOURCES))) 296 314 297 315 ifneq ($(BINARY),) … … 338 356 endif 339 357 358 ifneq ($(TEST_OUTPUT),) 359 $(TEST_OUTPUT): $(LINKER_SCRIPT) $(TEST_OBJECTS) $(TEST_OUTPUT_LIBS) 360 $(LD) -n $(LFLAGS) -T $(LINKER_SCRIPT) -M -Map $(TEST_OUTPUT).map -o $@ $(TEST_OBJECTS) $(TEST_OUTPUT_LIBS) $(LIBS) $(BASE_LIBS) 361 ifeq ($(CONFIG_STRIP_BINARIES),y) 362 $(STRIP) $(TEST_OUTPUT) 363 endif 364 endif 365 340 366 %.o: %.S $(DEPEND) 341 367 $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -c $< -o $@ … … 356 382 endif 357 383 384 %.test.o: %.c $(DEPEND) 385 $(CC) $(DEFS) $(CFLAGS) $(TEST_CFLAGS) -c $< -o $@ 386 ifeq ($(PRECHECK),y) 387 $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) 388 endif 389 358 390 %.lo: %.S $(DEPEND) 359 391 $(CC) $(DEFS) $(LIB_CFLAGS) -D__ASM__ -c $< -o $@ … … 375 407 376 408 $(DEPEND): $(PRE_DEPEND) 377 makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > $@ 2> /dev/null409 makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) $(TEST_SOURCES) > $@ 2> /dev/null 378 410 -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@ 379 411 -
uspace/app/bdsh/Makefile
rfa65df1 r6eb957dc 65 65 tok.c 66 66 67 TEST_SOURCES = \ 68 tok.c \ 69 test/toktest.c 70 67 71 include $(USPACE_PREFIX)/Makefile.common -
uspace/drv/bus/usb/usbhid/kbd/conv.c
rfa65df1 r6eb957dc 45 45 */ 46 46 static int scanmap_simple[255] = { 47 48 // [0x29] = KC_BACKTICK,49 50 // [0x02] = KC_1,51 // [0x03] = KC_2,52 47 [0x04] = KC_A, 53 48 [0x05] = KC_B, … … 94 89 [0x2c] = KC_SPACE, 95 90 96 [0x2d] = KC_MINUS, // same as DASH? (- or _)91 [0x2d] = KC_MINUS, 97 92 [0x2e] = KC_EQUALS, 98 93 [0x2f] = KC_LBRACKET, 99 94 [0x30] = KC_RBRACKET, 100 95 [0x31] = KC_BACKSLASH, 101 //[0x32] = KC_, // TODO: HASH??? maybe same as 0x31 - backslash 102 [0x32] = KC_BACKSLASH, 96 [0x32] = KC_HASH, 103 97 [0x33] = KC_SEMICOLON, 104 [0x34] = KC_QUOTE, // same as APOSTROPHE? (')105 [0x35] = KC_BACKTICK, // same as GRAVE ACCENT?? (`)98 [0x34] = KC_QUOTE, 99 [0x35] = KC_BACKTICK, 106 100 [0x36] = KC_COMMA, 107 101 [0x37] = KC_PERIOD, … … 137 131 [0x52] = KC_UP, 138 132 139 //[0x64] = // some funny key140 141 [0xe0] = KC_LCTRL,142 [0xe1] = KC_LSHIFT,143 [0xe2] = KC_LALT,144 //[0xe3] = KC_L // TODO: left GUI145 [0xe4] = KC_RCTRL,146 [0xe5] = KC_RSHIFT,147 [0xe6] = KC_RALT,148 //[0xe7] = KC_R // TODO: right GUI149 150 133 [0x53] = KC_NUM_LOCK, 151 134 [0x54] = KC_NSLASH, … … 164 147 [0x61] = KC_N9, 165 148 [0x62] = KC_N0, 166 [0x63] = KC_NPERIOD 149 [0x63] = KC_NPERIOD, 167 150 151 [0x64] = KC_BACKSLASH, 152 153 [0x9a] = KC_SYSREQ, 154 155 [0xe0] = KC_LCTRL, 156 [0xe1] = KC_LSHIFT, 157 [0xe2] = KC_LALT, 158 [0xe4] = KC_RCTRL, 159 [0xe5] = KC_RSHIFT, 160 [0xe6] = KC_RALT, 168 161 }; 169 162 … … 173 166 * 174 167 * @param scancode USB HID key code (from HID Usage Tables). 175 * 168 * 176 169 * @retval HelenOS key code corresponding to the given USB HID key code. 177 170 */ -
uspace/drv/char/xtkbd/main.c
rfa65df1 r6eb957dc 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvkbd 29 30 * @{ … … 60 61 /** Initialize global driver structures (NONE). 61 62 * 63 * Driver debug level is set here. 64 * 62 65 * @param[in] argc Nmber of arguments in argv vector (ignored). 63 66 * @param[in] argv Cmdline argument vector (ignored). 67 * 64 68 * @return Error code. 65 69 * 66 * Driver debug level is set here.67 70 */ 68 71 int main(int argc, char *argv[]) … … 76 79 * 77 80 * @param[in] device DDF instance of the device to initialize. 81 * 78 82 * @return Error code. 83 * 79 84 */ 80 85 static int xt_kbd_add(ddf_dev_t *device) … … 102 107 return EOK; 103 108 } 109 104 110 /** 105 111 * @} -
uspace/drv/char/xtkbd/xtkbd.c
rfa65df1 r6eb957dc 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvkbd 29 30 * @{ 30 31 */ 31 32 /** @file 32 * @brief XT keyboard driver ;33 * @brief XT keyboard driver 33 34 */ 34 35 … … 40 41 #include <ipc/kbdev.h> 41 42 #include <abi/ipc/methods.h> 42 43 43 #include "xtkbd.h" 44 44 45 45 /** Scancode set 1 table. */ 46 static const int scanmap_simple[] = { 47 46 static const unsigned int scanmap_simple[] = { 48 47 [0x29] = KC_BACKTICK, 49 48 50 49 [0x02] = KC_1, 51 50 [0x03] = KC_2, … … 58 57 [0x0a] = KC_9, 59 58 [0x0b] = KC_0, 60 59 61 60 [0x0c] = KC_MINUS, 62 61 [0x0d] = KC_EQUALS, 63 62 [0x0e] = KC_BACKSPACE, 64 63 65 64 [0x0f] = KC_TAB, 66 65 67 66 [0x10] = KC_Q, 68 67 [0x11] = KC_W, … … 75 74 [0x18] = KC_O, 76 75 [0x19] = KC_P, 77 76 78 77 [0x1a] = KC_LBRACKET, 79 78 [0x1b] = KC_RBRACKET, 80 79 81 80 [0x3a] = KC_CAPS_LOCK, 82 81 83 82 [0x1e] = KC_A, 84 83 [0x1f] = KC_S, … … 90 89 [0x25] = KC_K, 91 90 [0x26] = KC_L, 92 91 93 92 [0x27] = KC_SEMICOLON, 94 93 [0x28] = KC_QUOTE, 95 94 [0x2b] = KC_BACKSLASH, 96 95 97 96 [0x2a] = KC_LSHIFT, 98 97 99 98 [0x2c] = KC_Z, 100 99 [0x2d] = KC_X, … … 104 103 [0x31] = KC_N, 105 104 [0x32] = KC_M, 106 105 107 106 [0x33] = KC_COMMA, 108 107 [0x34] = KC_PERIOD, 109 108 [0x35] = KC_SLASH, 110 109 111 110 [0x36] = KC_RSHIFT, 112 111 113 112 [0x1d] = KC_LCTRL, 114 113 [0x38] = KC_LALT, 115 114 [0x39] = KC_SPACE, 116 115 117 116 [0x01] = KC_ESCAPE, 118 117 119 118 [0x3b] = KC_F1, 120 119 [0x3c] = KC_F2, … … 124 123 [0x40] = KC_F6, 125 124 [0x41] = KC_F7, 126 125 127 126 [0x42] = KC_F8, 128 127 [0x43] = KC_F9, 129 128 [0x44] = KC_F10, 130 129 131 130 [0x57] = KC_F11, 132 131 [0x58] = KC_F12, 133 132 134 133 [0x46] = KC_SCROLL_LOCK, 135 134 136 135 [0x1c] = KC_ENTER, 137 136 138 137 [0x45] = KC_NUM_LOCK, 139 138 [0x37] = KC_NTIMES, … … 153 152 }; 154 153 155 #define KBD_ACK 0xfa 156 #define KBD_RESEND 0xfe 157 #define KBD_SCANCODE_SET_EXTENDED 0xe0 154 #define KBD_ACK 0xfa 155 #define KBD_RESEND 0xfe 156 #define KBD_SCANCODE_SET_EXTENDED 0xe0 157 #define KBD_SCANCODE_SET_EXTENDED_SPECIAL 0xe1 158 158 159 /** Scancode set 1 extended codes table */ 159 static const int scanmap_e0[] = {160 static const unsigned int scanmap_e0[] = { 160 161 [0x38] = KC_RALT, 161 162 [0x1d] = KC_RCTRL, 162 163 [0x37] = KC_ PRTSCR,164 163 164 [0x37] = KC_SYSREQ, 165 165 166 [0x52] = KC_INSERT, 166 167 [0x47] = KC_HOME, 167 168 [0x49] = KC_PAGE_UP, 168 169 169 170 [0x53] = KC_DELETE, 170 171 [0x4f] = KC_END, 171 172 [0x51] = KC_PAGE_DOWN, 172 173 173 174 [0x48] = KC_UP, 174 175 [0x4b] = KC_LEFT, 175 176 [0x50] = KC_DOWN, 176 177 [0x4d] = KC_RIGHT, 177 178 178 179 [0x35] = KC_NSLASH, 179 180 [0x1c] = KC_NENTER 180 181 }; 181 182 182 #define KBD_CMD_SET_LEDS 0xed 183 #define KBD_CMD_SET_LEDS 0xed 184 183 185 enum led_indicators { 184 LI_SCROLL 185 LI_NUM 186 LI_CAPS = 0x04,186 LI_SCROLL = 0x01, 187 LI_NUM = 0x02, 188 LI_CAPS = 0x04 187 189 }; 188 190 189 static int polling(void *); 190 static void default_connection_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *); 191 192 /** Keyboard function ops. */ 193 static ddf_dev_ops_t kbd_ops = { 194 .default_handler = default_connection_handler 195 }; 196 197 /** Initialize keyboard driver structure. 198 * @param kbd Keyboard driver structure to initialize. 199 * @param dev DDF device structure. 200 * 201 * Connects to parent, creates keyboard function, starts polling fibril. 202 */ 203 int xt_kbd_init(xt_kbd_t *kbd, ddf_dev_t *dev) 191 static void push_event(async_sess_t *sess, kbd_event_type_t type, 192 unsigned int key) 204 193 { 194 async_exch_t *exch = async_exchange_begin(sess); 195 async_msg_4(exch, KBDEV_EVENT, type, key, 0, 0); 196 async_exchange_end(exch); 197 } 198 199 /** Get data and parse scancodes. 200 * 201 * @param arg Pointer to xt_kbd_t structure. 202 * 203 * @return EIO on error. 204 * 205 */ 206 static int polling(void *arg) 207 { 208 const xt_kbd_t *kbd = arg; 209 205 210 assert(kbd); 206 assert(dev);207 kbd->client_sess = NULL;208 kbd->parent_sess = ddf_dev_parent_sess_create(dev, EXCHANGE_SERIALIZE);209 if (!kbd->parent_sess) {210 ddf_msg(LVL_ERROR, "Failed creating parent session.");211 return EIO;212 }213 214 kbd->kbd_fun = ddf_fun_create(dev, fun_exposed, "kbd");215 if (!kbd->kbd_fun) {216 ddf_msg(LVL_ERROR, "Failed creating function 'kbd'.");217 return ENOMEM;218 }219 ddf_fun_set_ops(kbd->kbd_fun, &kbd_ops);220 221 int ret = ddf_fun_bind(kbd->kbd_fun);222 if (ret != EOK) {223 ddf_msg(LVL_ERROR, "Failed binding function 'kbd'.");224 ddf_fun_destroy(kbd->kbd_fun);225 return EEXIST;226 }227 228 ret = ddf_fun_add_to_category(kbd->kbd_fun, "keyboard");229 if (ret != EOK) {230 ddf_msg(LVL_ERROR, "Failed adding function 'kbd' to category "231 "'keyboard'.");232 ddf_fun_unbind(kbd->kbd_fun);233 ddf_fun_destroy(kbd->kbd_fun);234 return ENOMEM;235 }236 237 kbd->polling_fibril = fibril_create(polling, kbd);238 if (!kbd->polling_fibril) {239 ddf_msg(LVL_ERROR, "Failed creating polling fibril.");240 ddf_fun_unbind(kbd->kbd_fun);241 ddf_fun_destroy(kbd->kbd_fun);242 return ENOMEM;243 }244 245 fibril_add_ready(kbd->polling_fibril);246 return EOK;247 }248 249 /** Get data and parse scancodes.250 * @param arg Pointer to xt_kbd_t structure.251 * @return EIO on error.252 */253 int polling(void *arg)254 {255 assert(arg);256 const xt_kbd_t *kbd = arg;257 258 211 assert(kbd->parent_sess); 212 259 213 async_exch_t *parent_exch = async_exchange_begin(kbd->parent_sess); 260 while (1) { 214 215 while (true) { 261 216 if (!parent_exch) 262 217 parent_exch = async_exchange_begin(kbd->parent_sess); 263 264 const int *map = scanmap_simple;265 size_t map_size = sizeof(scanmap_simple) / sizeof( int);266 218 219 const unsigned int *map = scanmap_simple; 220 size_t map_size = sizeof(scanmap_simple) / sizeof(unsigned int); 221 267 222 uint8_t code = 0; 268 223 ssize_t size = chardev_read(parent_exch, &code, 1); 269 224 if (size != 1) 270 225 return EIO; 271 272 /** Ignore AT command reply */ 273 if (code == KBD_ACK || code == KBD_RESEND) { 226 227 /* Ignore AT command reply */ 228 if ((code == KBD_ACK) || (code == KBD_RESEND)) 229 continue; 230 231 /* Extended set */ 232 if (code == KBD_SCANCODE_SET_EXTENDED) { 233 map = scanmap_e0; 234 map_size = sizeof(scanmap_e0) / sizeof(unsigned int); 235 236 size = chardev_read(parent_exch, &code, 1); 237 if (size != 1) 238 return EIO; 239 240 /* Handle really special keys */ 241 242 if (code == 0x2a) { /* Print Screen */ 243 size = chardev_read(parent_exch, &code, 1); 244 if (size != 1) 245 return EIO; 246 247 if (code != 0xe0) 248 continue; 249 250 size = chardev_read(parent_exch, &code, 1); 251 if (size != 1) 252 return EIO; 253 254 if (code == 0x37) 255 push_event(kbd->client_sess, KEY_PRESS, KC_PRTSCR); 256 257 continue; 258 } 259 260 if (code == 0x46) { /* Break */ 261 size = chardev_read(parent_exch, &code, 1); 262 if (size != 1) 263 return EIO; 264 265 if (code != 0xe0) 266 continue; 267 268 size = chardev_read(parent_exch, &code, 1); 269 if (size != 1) 270 return EIO; 271 272 if (code == 0xc6) 273 push_event(kbd->client_sess, KEY_PRESS, KC_BREAK); 274 275 continue; 276 } 277 } 278 279 /* Extended special set */ 280 if (code == KBD_SCANCODE_SET_EXTENDED_SPECIAL) { 281 size = chardev_read(parent_exch, &code, 1); 282 if (size != 1) 283 return EIO; 284 285 if (code != 0x1d) 286 continue; 287 288 size = chardev_read(parent_exch, &code, 1); 289 if (size != 1) 290 return EIO; 291 292 if (code != 0x45) 293 continue; 294 295 size = chardev_read(parent_exch, &code, 1); 296 if (size != 1) 297 return EIO; 298 299 if (code != 0xe1) 300 continue; 301 302 size = chardev_read(parent_exch, &code, 1); 303 if (size != 1) 304 return EIO; 305 306 if (code != 0x9d) 307 continue; 308 309 size = chardev_read(parent_exch, &code, 1); 310 if (size != 1) 311 return EIO; 312 313 if (code == 0xc5) 314 push_event(kbd->client_sess, KEY_PRESS, KC_PAUSE); 315 274 316 continue; 275 317 } 276 277 if (code == KBD_SCANCODE_SET_EXTENDED) { 278 map = scanmap_e0; 279 map_size = sizeof(scanmap_e0) / sizeof(int); 280 size = chardev_read(parent_exch, &code, 1); 281 if (size != 1) 282 return EIO; 283 284 // TODO handle print screen 285 } 286 318 287 319 /* Bit 7 indicates press/release */ 288 320 const kbd_event_type_t type = 289 321 (code & 0x80) ? KEY_RELEASE : KEY_PRESS; 290 322 code &= ~0x80; 291 292 const unsigned key = (code < map_size) ? map[code] : 0; 293 if (key != 0) { 294 async_exch_t *exch = 295 async_exchange_begin(kbd->client_sess); 296 if (!exch) { 297 ddf_msg(LVL_ERROR, 298 "Failed creating exchange."); 299 continue; 300 } 301 async_msg_4(exch, KBDEV_EVENT, type, key, 0, 0); 302 async_exchange_end(exch); 303 } else { 323 324 const unsigned int key = (code < map_size) ? map[code] : 0; 325 326 if (key != 0) 327 push_event(kbd->client_sess, type, key); 328 else 304 329 ddf_msg(LVL_WARN, "Unknown scancode: %hhx", code); 305 }306 330 } 307 331 } … … 309 333 /** Default handler for IPC methods not handled by DDF. 310 334 * 311 * @param fun Device function handling the call.335 * @param fun Device function handling the call. 312 336 * @param icallid Call id. 313 * @param icall Call data. 314 */ 315 void default_connection_handler(ddf_fun_t *fun, 337 * @param icall Call data. 338 * 339 */ 340 static void default_connection_handler(ddf_fun_t *fun, 316 341 ipc_callid_t icallid, ipc_call_t *icall) 317 342 { … … 321 346 switch (method) { 322 347 case KBDEV_SET_IND: { 323 /* XT keyboards do not support setting mods, 324 * assume AT keyboard with Scan Code Set 1 */ 348 /* 349 * XT keyboards do not support setting mods, 350 * assume AT keyboard with Scan Code Set 1. 351 */ 325 352 const unsigned mods = IPC_GET_ARG1(*icall); 326 353 const uint8_t status = 0 | … … 329 356 ((mods & KM_SCROLL_LOCK) ? LI_SCROLL : 0); 330 357 uint8_t cmds[] = { KBD_CMD_SET_LEDS, status }; 358 331 359 async_exch_t *exch = async_exchange_begin(kbd->parent_sess); 332 360 const ssize_t size = chardev_write(exch, cmds, sizeof(cmds)); 333 361 async_exchange_end(exch); 362 334 363 async_answer_0(icallid, size < 0 ? size : EOK); 335 364 break; 336 365 } 337 /* This might be ugly but async_callback_receive_start makes no 338 * difference for incorrect call and malloc failure. */ 366 /* 367 * This might be ugly but async_callback_receive_start makes no 368 * difference for incorrect call and malloc failure. 369 */ 339 370 case IPC_M_CONNECT_TO_ME: { 340 371 async_sess_t *sess = 341 372 async_callback_receive_start(EXCHANGE_SERIALIZE, icall); 373 342 374 /* Probably ENOMEM error, try again. */ 343 375 if (sess == NULL) { … … 347 379 break; 348 380 } 381 349 382 if (kbd->client_sess == NULL) { 350 383 kbd->client_sess = sess; … … 355 388 async_answer_0(icallid, ELIMIT); 356 389 } 390 357 391 break; 358 392 } 359 393 default: 360 361 362 394 ddf_msg(LVL_ERROR, "Unknown method: %d.", (int)method); 395 async_answer_0(icallid, EINVAL); 396 break; 363 397 } 364 398 } 399 400 /** Keyboard function ops. */ 401 static ddf_dev_ops_t kbd_ops = { 402 .default_handler = default_connection_handler 403 }; 404 405 /** Initialize keyboard driver structure. 406 * 407 * @param kbd Keyboard driver structure to initialize. 408 * @param dev DDF device structure. 409 * 410 * Connects to parent, creates keyboard function, starts polling fibril. 411 * 412 */ 413 int xt_kbd_init(xt_kbd_t *kbd, ddf_dev_t *dev) 414 { 415 assert(kbd); 416 assert(dev); 417 418 kbd->client_sess = NULL; 419 kbd->parent_sess = ddf_dev_parent_sess_create(dev, EXCHANGE_SERIALIZE); 420 421 if (!kbd->parent_sess) { 422 ddf_msg(LVL_ERROR, "Failed creating parent session."); 423 return EIO; 424 } 425 426 kbd->kbd_fun = ddf_fun_create(dev, fun_exposed, "kbd"); 427 if (!kbd->kbd_fun) { 428 ddf_msg(LVL_ERROR, "Failed creating function 'kbd'."); 429 return ENOMEM; 430 } 431 432 ddf_fun_set_ops(kbd->kbd_fun, &kbd_ops); 433 434 int ret = ddf_fun_bind(kbd->kbd_fun); 435 if (ret != EOK) { 436 ddf_msg(LVL_ERROR, "Failed binding function 'kbd'."); 437 ddf_fun_destroy(kbd->kbd_fun); 438 return EEXIST; 439 } 440 441 ret = ddf_fun_add_to_category(kbd->kbd_fun, "keyboard"); 442 if (ret != EOK) { 443 ddf_msg(LVL_ERROR, "Failed adding function 'kbd' to category " 444 "'keyboard'."); 445 ddf_fun_unbind(kbd->kbd_fun); 446 ddf_fun_destroy(kbd->kbd_fun); 447 return ENOMEM; 448 } 449 450 kbd->polling_fibril = fibril_create(polling, kbd); 451 if (!kbd->polling_fibril) { 452 ddf_msg(LVL_ERROR, "Failed creating polling fibril."); 453 ddf_fun_unbind(kbd->kbd_fun); 454 ddf_fun_destroy(kbd->kbd_fun); 455 return ENOMEM; 456 } 457 458 fibril_add_ready(kbd->polling_fibril); 459 return EOK; 460 } -
uspace/drv/char/xtkbd/xtkbd.h
rfa65df1 r6eb957dc 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvkbd 29 30 * @{ … … 47 48 } xt_kbd_t; 48 49 49 int xt_kbd_init(xt_kbd_t *, ddf_dev_t *);50 extern int xt_kbd_init(xt_kbd_t *, ddf_dev_t *); 50 51 51 52 #endif 53 52 54 /** 53 55 * @} -
uspace/lib/c/Makefile
rfa65df1 r6eb957dc 165 165 $(ARCH_SOURCES) 166 166 167 TEST_SOURCES = \ 168 test/main.c \ 169 test/sprintf.c 170 167 171 include $(USPACE_PREFIX)/Makefile.common 168 172 -
uspace/lib/c/generic/bd_srv.c
rfa65df1 r6eb957dc 70 70 async_answer_0(rcallid, ENOTSUP); 71 71 async_answer_0(callid, ENOTSUP); 72 free(buf); 72 73 return; 73 74 } … … 77 78 async_answer_0(rcallid, ENOMEM); 78 79 async_answer_0(callid, ENOMEM); 80 free(buf); 79 81 return; 80 82 } … … 112 114 async_answer_0(rcallid, ENOTSUP); 113 115 async_answer_0(callid, ENOTSUP); 116 free(buf); 114 117 return; 115 118 } … … 119 122 async_answer_0(rcallid, ENOMEM); 120 123 async_answer_0(callid, ENOMEM); 124 free(buf); 121 125 return; 122 126 } -
uspace/lib/c/generic/io/con_srv.c
rfa65df1 r6eb957dc 89 89 async_answer_0(rcallid, ENOTSUP); 90 90 async_answer_0(callid, ENOTSUP); 91 free(buf); 91 92 return; 92 93 } … … 96 97 async_answer_0(rcallid, rc); 97 98 async_answer_0(callid, rc); 99 free(buf); 98 100 return; 99 101 } -
uspace/lib/c/include/io/keycode.h
rfa65df1 r6eb957dc 107 107 KC_QUOTE, 108 108 KC_BACKSLASH, 109 KC_HASH, 109 110 110 111 KC_ENTER, … … 154 155 155 156 KC_PRTSCR, 157 KC_SYSREQ, 156 158 KC_SCROLL_LOCK, 157 159 KC_PAUSE, 160 KC_BREAK, 158 161 159 162 /* Cursor keys block */ -
uspace/lib/posix/Makefile
rfa65df1 r6eb957dc 79 79 source/unistd.c 80 80 81 TEST_SOURCES = \ 82 test/main.c \ 83 test/scanf.c 84 81 85 include $(USPACE_PREFIX)/Makefile.common 82 86 -
uspace/lib/posix/source/stdio/scanf.c
rfa65df1 r6eb957dc 1220 1220 } 1221 1221 1222 // FIXME: put the testcases to the app/tester after scanf is included into libc1223 1224 #if 01225 1226 //#include <stdio.h>1227 //#include <malloc.h>1228 //#include <string.h>1229 1230 #define test_val(fmt, exp_val, act_val) \1231 if (exp_val == act_val) { \1232 printf("succ, expected "fmt", actual "fmt"\n", exp_val, act_val); \1233 } else { \1234 printf("fail, expected "fmt", actual "fmt"\n", exp_val, act_val); \1235 ++fail; \1236 }1237 1238 #define test_str(fmt, exp_str, act_str) \1239 if (posix_strcmp(exp_str, act_str) == 0) { \1240 printf("succ, expected "fmt", actual "fmt"\n", exp_str, act_str); \1241 } else { \1242 printf("fail, expected "fmt", actual "fmt"\n", exp_str, act_str); \1243 ++fail; \1244 }1245 1246 void __posix_scanf_test(void);1247 void __posix_scanf_test(void)1248 {1249 int fail = 0;1250 1251 int ret;1252 1253 unsigned char uhh;1254 signed char shh;1255 unsigned short uh;1256 short sh;1257 unsigned udef;1258 int sdef;1259 unsigned long ul;1260 long sl;1261 unsigned long long ull;1262 long long sll;1263 void *p;1264 1265 float f;1266 double d;1267 long double ld;1268 1269 char str[20];1270 char seq[20];1271 char scanset[20];1272 1273 char *pstr;1274 char *pseq;1275 char *pscanset;1276 1277 ret = posix_sscanf(1278 "\n j tt % \t -121314 98765 aqw 0765 0x77 0xABCDEF88 -99 884",1279 " j tt %%%3hhd%1hhu%3hd %3hu%u aqw%n %lo%llx %p %li %lld",1280 &shh, &uhh, &sh, &uh, &udef, &sdef, &ul, &ull, &p, &sl, &sll);1281 test_val("%d", -12, shh);1282 test_val("%u", 1, uhh);1283 test_val("%d", 314, sh);1284 test_val("%u", 987, uh);1285 test_val("%u", 65, udef);1286 test_val("%d", 28, sdef);1287 test_val("%lo", (unsigned long) 0765, ul);1288 test_val("%llx", (unsigned long long) 0x77, ull);1289 test_val("%p", (void *) 0xABCDEF88, p);1290 test_val("%ld", (long) -99, sl);1291 test_val("%lld", (long long) 884, sll);1292 test_val("%d", 10, ret);1293 1294 ret = posix_sscanf(1295 "\n \t\t1.0 -0x555.AP10 1234.5678e12",1296 "%f %lf %Lf",1297 &f, &d, &ld);1298 test_val("%f", 1.0, f);1299 test_val("%lf", (double) -0x555.AP10, d);1300 test_val("%Lf", (long double) 1234.5678e12, ld);1301 test_val("%d", 3, ret);1302 1303 ret = posix_sscanf(1304 "\n\n\thello world \n",1305 "%5s %ms",1306 str, &pstr);1307 test_str("%s", "hello", str);1308 test_str("%s", "world", pstr);1309 test_val("%d", 2, ret);1310 free(pstr);1311 1312 ret = posix_sscanf(1313 "\n\n\thello world \n",1314 " %5c %mc",1315 seq, &pseq);1316 seq[5] = '\0';1317 pseq[1] = '\0';1318 test_str("%s", "hello", seq);1319 test_str("%s", "w", pseq);1320 test_val("%d", 2, ret);1321 free(pseq);1322 1323 ret = posix_sscanf(1324 "\n\n\th-e-l-l-o world-] \n",1325 " %9[-eh-o] %m[^]-]",1326 scanset, &pscanset);1327 test_str("%s", "h-e-l-l-o", scanset);1328 test_str("%s", "world", pscanset);1329 test_val("%d", 2, ret);1330 free(pscanset);1331 1332 printf("Failed: %d\n", fail);1333 }1334 1335 #endif1336 1337 1222 /** @} 1338 1223 */ -
uspace/lib/uri/Makefile
rfa65df1 r6eb957dc 36 36 uri.c 37 37 38 TEST_SOURCES = \ 39 test/main.c \ 40 test/parser.c 41 38 42 include $(USPACE_PREFIX)/Makefile.common -
uspace/srv/hid/compositor/compositor.c
rfa65df1 r6eb957dc 1820 1820 bool viewport_change = (mods & KM_ALT) && ( 1821 1821 key == KC_O || key == KC_P); 1822 bool kconsole_switch = ( mods & KM_ALT) && (key == KC_M);1822 bool kconsole_switch = (key == KC_PAUSE) || (key == KC_BREAK); 1823 1823 bool filter_switch = (mods & KM_ALT) && (key == KC_Y); 1824 1824 -
uspace/srv/hid/input/ctl/apple.c
rfa65df1 r6eb957dc 52 52 }; 53 53 54 #define KBD_KEY_RELEASE 0x80 55 56 static kbd_dev_t *kbd_dev; 57 58 static int scanmap[]; 59 60 static int apple_ctl_init(kbd_dev_t *kdev) 61 { 62 kbd_dev = kdev; 63 return 0; 64 } 65 66 static void apple_ctl_parse(sysarg_t scancode) 67 { 68 kbd_event_type_t type; 69 unsigned int key; 70 71 if (scancode >= 0x100) 72 return; 73 74 if (scancode & KBD_KEY_RELEASE) { 75 scancode &= ~KBD_KEY_RELEASE; 76 type = KEY_RELEASE; 77 } else { 78 type = KEY_PRESS; 79 } 80 81 key = scanmap[scancode]; 82 if (key != 0) 83 kbd_push_event(kbd_dev, type, key); 84 } 85 86 static void apple_ctl_set_ind(kbd_dev_t *kdev, unsigned mods) 87 { 88 (void) mods; 89 } 90 91 static int scanmap[] = { 54 #define KBD_KEY_RELEASE 0x80 55 56 static unsigned int scanmap[] = { 92 57 [0x00] = KC_A, 93 58 [0x01] = KC_S, … … 195 160 [0x67] = KC_F11, 196 161 [0x68] = 0, 197 [0x69] = 0,162 [0x69] = KC_SYSREQ, 198 163 [0x6a] = 0, 199 164 [0x6b] = KC_SCROLL_LOCK, … … 203 168 [0x6f] = KC_F12, 204 169 [0x70] = 0, 205 [0x71] = 0,170 [0x71] = KC_PAUSE, 206 171 [0x72] = KC_INSERT, 207 172 [0x73] = KC_HOME, … … 220 185 }; 221 186 187 static kbd_dev_t *kbd_dev; 188 189 static int apple_ctl_init(kbd_dev_t *kdev) 190 { 191 kbd_dev = kdev; 192 return 0; 193 } 194 195 static void apple_ctl_parse(sysarg_t scancode) 196 { 197 kbd_event_type_t type; 198 199 if (scancode & KBD_KEY_RELEASE) { 200 scancode &= ~KBD_KEY_RELEASE; 201 type = KEY_RELEASE; 202 } else 203 type = KEY_PRESS; 204 205 if (scancode >= sizeof(scanmap) / sizeof(unsigned int)) 206 return; 207 208 unsigned int key = scanmap[scancode]; 209 if (key != 0) 210 kbd_push_event(kbd_dev, type, key); 211 } 212 213 static void apple_ctl_set_ind(kbd_dev_t *kdev, unsigned mods) 214 { 215 (void) mods; 216 } 217 222 218 /** @} 223 219 */ -
uspace/srv/hid/input/ctl/stty.c
rfa65df1 r6eb957dc 212 212 0, KC_F12, 0x1b, 0x5b, 0x32, 0x34, 0x7e, GSP_END, 213 213 214 0, KC_PRTSCR, 0x1b, 0x5b, 0x32, 0x35, 0x7e, GSP_END, 215 0, KC_PAUSE, 0x1b, 0x5b, 0x32, 0x38, 0x7e, GSP_END, 216 214 217 0, KC_INSERT, 0x1b, 0x5b, 0x32, 0x7e, GSP_END, 215 218 0, KC_HOME, 0x1b, 0x5b, 0x48, GSP_END, -
uspace/srv/hid/input/ctl/sun.c
rfa65df1 r6eb957dc 118 118 [0x14] = KC_UP, 119 119 [0x15] = KC_PAUSE, 120 [0x16] = 0,120 [0x16] = KC_PRTSCR, 121 121 [0x17] = KC_SCROLL_LOCK, 122 122 [0x18] = KC_LEFT, -
uspace/srv/hid/input/input.c
rfa65df1 r6eb957dc 90 90 static client_t *active_client = NULL; 91 91 92 /** Kernel override */ 93 static bool active = true; 94 92 95 /** List of keyboard devices */ 93 96 static list_t kbd_devs; … … 295 298 296 299 /** Arbitrate client actiovation */ 297 static void client_arbitration( client_t *req)300 static void client_arbitration(void) 298 301 { 299 302 /* Mutual exclusion of active clients */ 300 303 list_foreach(clients, link, client_t, client) 301 client->active = ( client == req);304 client->active = ((active) && (client == active_client)); 302 305 303 306 /* Notify clients about the arbitration */ … … 347 350 case INPUT_ACTIVATE: 348 351 active_client = client; 349 client_arbitration( client);352 client_arbitration(); 350 353 async_answer_0(callid, EOK); 351 354 break; … … 362 365 if (IPC_GET_ARG1(*call)) { 363 366 /* Kernel console activated */ 364 client_arbitration(NULL);367 active = false; 365 368 } else { 366 369 /* Kernel console deactivated */ 367 client_arbitration(active_client); 368 } 370 active = true; 371 } 372 373 client_arbitration(); 369 374 } 370 375 -
uspace/srv/net/tcp/ucall.c
rfa65df1 r6eb957dc 76 76 nconn = tcp_conn_new(lsock, fsock); 77 77 tcp_conn_add(nconn); 78 tcp_conn_lock(nconn); 78 79 79 80 if (acpass == ap_active) { … … 83 84 84 85 if (oflags == tcp_open_nonblock) { 86 tcp_conn_unlock(nconn); 85 87 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open -> %p", nconn); 86 88 *conn = nconn; … … 90 92 /* Wait for connection to be established or reset */ 91 93 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open: Wait for connection."); 92 tcp_conn_lock(nconn);93 94 while (nconn->cstate == st_listen || 94 95 nconn->cstate == st_syn_sent ||
Note:
See TracChangeset
for help on using the changeset viewer.