Changes in / [c483fca:c742954] in mainline
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia64/src/drivers/ski.c
rc483fca rc742954 37 37 #include <console/console.h> 38 38 #include <console/chardev.h> 39 #include <ddi/ddi.h>40 39 #include <sysinfo/sysinfo.h> 41 40 #include <stdint.h> … … 70 69 71 70 static ski_instance_t *instance = NULL; 72 static parea_t ski_parea;73 71 74 72 /** Ask debug console if a key was pressed. … … 107 105 int count = POLL_LIMIT; 108 106 109 if (ski_parea.mapped && !console_override)110 return;111 112 107 while (count > 0) { 113 108 wchar_t ch = ski_getchar(); … … 127 122 128 123 while (true) { 129 poll_keyboard(instance); 124 // TODO FIXME: 125 // This currently breaks the kernel console 126 // before we get the override from uspace. 127 if (console_override) 128 poll_keyboard(instance); 129 130 130 thread_usleep(POLL_INTERVAL); 131 131 } … … 140 140 static void ski_init(void) 141 141 { 142 uintptr_t faddr;143 144 142 if (instance) 145 143 return; … … 152 150 : "r15", "r8" 153 151 ); 154 155 faddr = frame_alloc(1, FRAME_LOWMEM | FRAME_ATOMIC, 0);156 if (faddr == 0)157 panic("Cannot allocate page for ski console.");158 159 ddi_parea_init(&ski_parea);160 ski_parea.pbase = faddr;161 ski_parea.frames = 1;162 ski_parea.unpriv = false;163 ski_parea.mapped = false;164 ddi_parea_register(&ski_parea);165 166 sysinfo_set_item_val("ski.paddr", NULL, (sysarg_t) faddr);167 152 168 153 instance = malloc(sizeof(ski_instance_t)); … … 205 190 static void ski_putwchar(outdev_t *dev, wchar_t ch) 206 191 { 207 if (ski_parea.mapped && !console_override) 208 return; 209 210 if (ascii_check(ch)) { 211 if (ch == '\n') 212 ski_do_putchar('\r'); 213 214 ski_do_putchar(ch); 215 } else { 216 ski_do_putchar('?'); 192 // TODO FIXME: 193 // This currently breaks the kernel console 194 // before we get the override from uspace. 195 if (console_override) { 196 if (ascii_check(ch)) { 197 if (ch == '\n') 198 ski_do_putchar('\r'); 199 200 ski_do_putchar(ch); 201 } else { 202 ski_do_putchar('?'); 203 } 217 204 } 218 205 } -
kernel/generic/include/mm/as.h
rc483fca rc742954 268 268 269 269 extern as_t *as_create(unsigned int); 270 extern void as_destroy(as_t *); 270 271 extern void as_hold(as_t *); 271 272 extern void as_release(as_t *); -
kernel/generic/src/console/console.c
rc483fca rc742954 209 209 void grab_console(void) 210 210 { 211 sysinfo_set_item_val("kconsole", NULL, true);212 211 event_notify_1(EVENT_KCONSOLE, false, true); 213 212 bool prev = console_override; … … 227 226 void release_console(void) 228 227 { 229 sysinfo_set_item_val("kconsole", NULL, false);230 228 console_override = false; 231 229 event_notify_1(EVENT_KCONSOLE, false, false); -
kernel/generic/src/mm/as.c
rc483fca rc742954 187 187 * 188 188 */ 189 staticvoid as_destroy(as_t *as)189 void as_destroy(as_t *as) 190 190 { 191 191 DEADLOCK_PROBE_INIT(p_asidlock); -
kernel/generic/src/proc/program.c
rc483fca rc742954 150 150 prg->loader_status = elf_load((elf_header_t *) image_addr, as); 151 151 if (prg->loader_status != EE_OK) { 152 as_ release(as);152 as_destroy(as); 153 153 prg->task = NULL; 154 154 prg->main_thread = NULL; … … 176 176 void *loader = program_loader; 177 177 if (!loader) { 178 as_ release(as);178 as_destroy(as); 179 179 log(LF_OTHER, LVL_ERROR, 180 180 "Cannot spawn loader as none was registered"); … … 184 184 prg->loader_status = elf_load((elf_header_t *) program_loader, as); 185 185 if (prg->loader_status != EE_OK) { 186 as_ release(as);186 as_destroy(as); 187 187 log(LF_OTHER, LVL_ERROR, "Cannot spawn loader (%s)", 188 188 elf_error(prg->loader_status)); -
tools/xcw/bin/helenos-bld-config
rc483fca rc742954 33 33 34 34 SRC_ROOT="$(dirname "$0")/../../.." 35 if [ -z "$EXPORT_DIR" ]; then 36 EXPORT_DIR="$SRC_ROOT/uspace/export" 37 fi 38 MAKEFILE_COMMON="$EXPORT_DIR"/Makefile.common 39 MAKEFILE_CONFIG="$EXPORT_DIR"/Makefile.config 40 CONFIG_MK="$EXPORT_DIR"/config.mk 35 MAKEFILE_COMMON="$SRC_ROOT"/Makefile.common 36 MAKEFILE_CONFIG="$SRC_ROOT"/Makefile.config 37 CONFIG_MK="$SRC_ROOT"/uspace/export/config.mk 41 38 42 39 # Extract simple 'name = value' variable definition from Makefile -
tools/xcw/bin/helenos-cc
rc483fca rc742954 34 34 XCW="$(dirname "$0")" 35 35 SRC_ROOT="$XCW/../../.." 36 if [ -z "$EXPORT_DIR" ]; then37 EXPORT_DIR="$SRC_ROOT/uspace/export"38 fi39 36 UARCH="$("$XCW"/helenos-bld-config --uarch)" 40 37 CC="$("$XCW"/helenos-bld-config --cc)" … … 52 49 "$@" \ 53 50 -I"$XCW"/../include \ 54 -I"$EXPORT_DIR"/include/libc \ 55 -I"$EXPORT_DIR"/include 51 -I"$SRC_ROOT"/uspace/lib/c/include \ 52 -I"$SRC_ROOT"/abi/include \ 53 -I"$SRC_ROOT"/uspace/lib/c/arch/"$UARCH"/include -
tools/xcw/bin/helenos-ld
rc483fca rc742954 34 34 XCW="$(dirname "$0")" 35 35 SRC_ROOT="$XCW/../../.." 36 if [ -z "$EXPORT_DIR" ]; then37 EXPORT_DIR="$SRC_ROOT/uspace/export"38 fi39 36 UARCH="$("$XCW"/helenos-bld-config --uarch)" 40 37 CFLAGS="$("$XCW"/helenos-bld-config --cflags)" … … 46 43 $CFLAGS \ 47 44 "$@" \ 48 "$ EXPORT_DIR"/lib/crt0.o \49 "$ EXPORT_DIR"/lib/crt1.o \50 "$ EXPORT_DIR"/lib/libc.a \45 "$SRC_ROOT"/uspace/lib/c/crt0.o \ 46 "$SRC_ROOT"/uspace/lib/c/crt1.o \ 47 "$SRC_ROOT"/uspace/lib/c/libc.a \ 51 48 -lgcc -
tools/xcw/bin/helenos-pkg-config
rc483fca rc742954 35 35 SRC_ROOT="$XCW/../../.." 36 36 UARCH="$("$XCW"/helenos-bld-config --uarch)" 37 if [ -z "$EXPORT_DIR" ]; then38 EXPORT_DIR="$SRC_ROOT/uspace/export"39 fi40 INCLUDE_DIR="$EXPORT_DIR/include"41 LIB_DIR="$EXPORT_DIR/lib"42 37 43 libmath_cflags="-I$INCLUDE_DIR/libmath" 44 libmath_libs="$LIB_DIR/libmath.a" 38 libmath_cflags="-I$SRC_ROOT/uspace/lib/math/include\ 39 -I$SRC_ROOT/uspace/lib/math/arch/$UARCH/include" 40 libmath_libs="$SRC_ROOT/uspace/lib/math/libmath.a" 45 41 46 libgui_cflags="-I$ INCLUDE_DIR/libgui"47 libgui_libs="$ LIB_DIR/libgui.a"42 libgui_cflags="-I$SRC_ROOT/uspace/lib/gui" 43 libgui_libs="$SRC_ROOT/uspace/lib/gui/libgui.a" 48 44 49 libdraw_cflags="-I$INCLUDE_DIR/libdraw" 50 libdraw_libs="$LIB_DIR/libdraw.a $LIB_DIR/libsoftrend.a" 45 libdraw_cflags="-I$SRC_ROOT/uspace/lib/draw" 46 libdraw_libs="$SRC_ROOT/uspace/lib/draw/libdraw.a \ 47 $SRC_ROOT/uspace/lib/softrend/libsoftrend.a" 51 48 52 libhound_cflags="-I$ INCLUDE_DIR/libhound"53 libhound_libs="$ LIB_DIR/libhound.a"49 libhound_cflags="-I$SRC_ROOT/uspace/lib/hound/include" 50 libhound_libs="$SRC_ROOT/uspace/lib/hound/libhound.a" 54 51 55 libpcm_cflags="-I$ INCLUDE_DIR/libpcm"56 libpcm_libs="$ LIB_DIR/libpcm.a"52 libpcm_cflags="-I$SRC_ROOT/uspace/lib/pcm/include" 53 libpcm_libs="$SRC_ROOT/uspace/lib/pcm/libpcm.a" 57 54 58 55 action=none -
uspace/Makefile
rc483fca rc742954 273 273 $(MAKE) -r -C $(basename $@) all-test PRECHECK=$(PRECHECK) 274 274 275 export: $(BUILDS)275 export: lib/posix.build lib/math.build lib/clui.build 276 276 $(MAKE) -r -C lib/posix export EXPORT_DIR=$(EXPORT_DIR) 277 277 -
uspace/app/fontviewer/fontviewer.c
rc483fca rc742954 170 170 source_t leading_bg = rgb(170, 238, 255); 171 171 source_t leading_fg = rgb(0, 170, 212); 172 font_t *info_font = NULL; 173 font_t *font = NULL; 174 172 173 font_t *font; 175 174 errno_t rc = create_font(&font, points); 176 175 if (rc != EOK) { 177 176 printf("Failed creating font\n"); 178 goto out_err; 179 } 180 177 return rc; 178 } 179 180 font_t *info_font; 181 181 rc = embedded_font_create(&info_font, 16); 182 182 if (rc != EOK) { 183 183 printf("Failed creating info font\n"); 184 goto out_err;184 return rc; 185 185 } 186 186 … … 188 188 rc = font_get_metrics(font, &font_metrics); 189 189 if (rc != EOK) 190 goto out_err;190 return rc; 191 191 192 192 surface_coord_t top = 50; … … 238 238 } 239 239 240 out_err: 241 if (font) 242 font_release(font); 243 if (info_font) 244 font_release(info_font); 245 return rc; 240 font_release(font); 241 return EOK; 246 242 } 247 243 -
uspace/drv/char/ski-con/ski-con.c
rc483fca rc742954 1 1 /* 2 2 * Copyright (c) 2005 Jakub Jermar 3 * Copyright (c) 201 8Jiri Svoboda3 * Copyright (c) 2017 Jiri Svoboda 4 4 * All rights reserved. 5 5 * … … 31 31 */ 32 32 33 #include <as.h>34 33 #include <async.h> 35 34 #include <ddf/driver.h> 36 35 #include <ddf/log.h> 37 #include <ddi.h>38 36 #include <errno.h> 39 37 #include <fibril.h> … … 42 40 #include <stdlib.h> 43 41 #include <stdbool.h> 44 #include <sysinfo.h>45 42 46 43 #include "ski-con.h" … … 71 68 ddf_fun_t *fun = NULL; 72 69 bool bound = false; 73 uintptr_t faddr;74 void *addr = AS_AREA_ANY;75 70 errno_t rc; 76 71 … … 92 87 con->cds.sarg = con; 93 88 94 rc = sysinfo_get_value("ski.paddr", &faddr);95 if (rc != EOK)96 faddr = 0; /* No kernel driver to arbitrate with */97 98 if (faddr != 0) {99 addr = AS_AREA_ANY;100 rc = physmem_map(faddr, 1, AS_AREA_READ | AS_AREA_CACHEABLE,101 &addr);102 if (rc != EOK) {103 ddf_msg(LVL_ERROR, "Cannot map kernel driver arbitration area.");104 goto error;105 }106 }107 108 89 rc = ddf_fun_bind(fun); 109 90 if (rc != EOK) { … … 126 107 return EOK; 127 108 error: 128 if (addr != AS_AREA_ANY)129 as_area_destroy(addr);130 109 if (bound) 131 110 ddf_fun_unbind(fun); … … 148 127 } 149 128 150 /** Detect if SKI console is in use by the kernel.151 *152 * This is needed since the kernel has no way of fencing off the user-space153 * driver.154 *155 * @return @c true if in use by the kernel.156 */157 static bool ski_con_disabled(void)158 {159 sysarg_t kconsole;160 161 /*162 * XXX Ideally we should get information from our kernel counterpart163 * driver. But there needs to be a mechanism for the kernel console164 * to inform the kernel driver.165 */166 if (sysinfo_get_value("kconsole", &kconsole) != EOK)167 return false;168 169 return kconsole != false;170 }171 172 129 /** Poll Ski for keypresses. */ 173 130 static errno_t ski_con_fibril(void *arg) … … 178 135 179 136 while (true) { 180 while ( !ski_con_disabled()) {137 while (true) { 181 138 c = ski_con_getchar(); 182 139 if (c == 0) … … 289 246 uint8_t *dp = (uint8_t *) data; 290 247 291 if (!ski_con_disabled()) { 292 for (i = 0; i < size; i++) { 293 ski_con_putchar(con, dp[i]); 294 } 295 } 248 for (i = 0; i < size; i++) 249 ski_con_putchar(con, dp[i]); 296 250 297 251 *nwr = size; -
uspace/drv/char/ski-con/ski-con.h
rc483fca rc742954 56 56 fibril_mutex_t buf_lock; 57 57 fibril_condvar_t buf_cv; 58 /** Memory area mapped to arbitrate with the kernel driver */59 void *mem_area;60 58 } ski_con_t; 61 59 -
uspace/lib/c/generic/loader.c
rc483fca rc742954 200 200 } 201 201 202 rc = loader_set_program(ldr, abspath, fd);202 rc = loader_set_program(ldr, path, fd); 203 203 vfs_put(fd); 204 204 return rc; -
uspace/lib/draw/font/bitmap_backend.c
rc483fca rc742954 212 212 213 213 data->decoder->release(data->decoder_data); 214 free(data);215 214 } 216 215 -
uspace/lib/drv/generic/driver.c
rc483fca rc742954 145 145 } 146 146 147 /* Add one reference that will be dropped by driver_dev_remove() */ 148 dev_add_ref(dev); 147 149 dev->handle = dev_handle; 148 150 dev->name = dev_name; … … 731 733 return NULL; 732 734 735 /* Add one reference that will be dropped by ddf_fun_destroy() */ 733 736 fun->dev = dev; 734 dev_add_ref(fun->dev);737 fun_add_ref(fun); 735 738 736 739 fun->bound = false; … … 740 743 fun->name = str_dup(name); 741 744 if (fun->name == NULL) { 742 fun_del_ref(fun); /* fun is destroyed */745 delete_function(fun); 743 746 return NULL; 744 747 } -
uspace/lib/hound/src/protocol.c
rc483fca rc742954 615 615 break; 616 616 default: 617 /* 618 * In case we called async_get_call() after we had 619 * already received IPC_M_PHONE_HUNGUP deeper in the 620 * protocol handling, the capability handle will be 621 * invalid, so act carefully here. 622 */ 623 if (call.cap_handle != CAP_NIL) 624 async_answer_0(&call, ENOTSUP); 617 async_answer_0(&call, ENOTSUP); 625 618 return; 626 619 } -
uspace/lib/posix/Makefile
rc483fca rc742954 36 36 ../math/libmath.a \ 37 37 ../clui/libclui.a \ 38 ../gui/libgui.a \39 ../draw/libdraw.a \40 ../softrend/libsoftrend.a \41 ../hound/libhound.a \42 ../pcm/libpcm.a \43 38 $(LIBC_PREFIX)/libc.a \ 44 39 $(LIBC_PREFIX)/crt0.o \ … … 98 93 include $(USPACE_PREFIX)/Makefile.common 99 94 100 export: $(EXPORT_DIR)/config.mk $(EXPORT_DIR)/config.rc \ 101 $(EXPORT_DIR)/Makefile.common $(EXPORT_DIR)/Makefile.config 95 export: $(EXPORT_DIR)/config.mk $(EXPORT_DIR)/config.rc 102 96 103 97 $(EXPORT_DIR)/config.mk: export-libs export-includes … … 117 111 sed 's:$$(HELENOS_EXPORT_ROOT):$$HELENOS_EXPORT_ROOT:g' < $< >$@ 118 112 119 $(EXPORT_DIR)/Makefile.common: ../../../Makefile.common120 cp $< $@121 122 $(EXPORT_DIR)/Makefile.config: ../../../Makefile.config123 cp $< $@124 125 113 export-libs: $(EXPORT_FILES) export-includes 126 114 mkdir -p $(EXPORT_DIR)/lib … … 136 124 cp -L ../clui/tinput.h $(EXPORT_DIR)/include.new/libclui 137 125 rm -rf $(EXPORT_DIR)/include 138 mkdir -p $(EXPORT_DIR)/include.new/libdraw139 cp -r -L -t $(EXPORT_DIR)/include.new/libdraw ../draw/*.h140 mkdir -p $(EXPORT_DIR)/include.new/libdraw/codec141 cp -r -L -t $(EXPORT_DIR)/include.new/libdraw/codec ../draw/codec/*.h142 mkdir -p $(EXPORT_DIR)/include.new/libgui143 cp -L -t $(EXPORT_DIR)/include.new/libgui ../gui/*.h144 mkdir -p $(EXPORT_DIR)/include.new/libhound145 cp -r -L -t $(EXPORT_DIR)/include.new/libhound ../hound/include/*146 mkdir -p $(EXPORT_DIR)/include.new/libpcm147 cp -r -L -t $(EXPORT_DIR)/include.new/libpcm ../pcm/include/*148 126 mv $(EXPORT_DIR)/include.new $(EXPORT_DIR)/include -
uspace/lib/usbhost/src/bus.c
rc483fca rc742954 370 370 int bus_endpoint_add(device_t *device, const usb_endpoint_descriptors_t *desc, endpoint_t **out_ep) 371 371 { 372 int err = EINVAL;372 int err; 373 373 assert(device); 374 374 … … 392 392 assert((ep->required_transfer_buffer_policy & ~ep->transfer_buffer_policy) == 0); 393 393 394 /* Bus reference */ 395 endpoint_add_ref(ep); 396 394 397 const size_t idx = bus_endpoint_index(ep->endpoint, ep->direction); 395 398 if (idx >= ARRAY_SIZE(device->endpoints)) { … … 422 425 } 423 426 fibril_mutex_unlock(&device->guard); 424 if (err) 425 goto drop; 427 if (err) { 428 endpoint_del_ref(ep); 429 return err; 430 } 426 431 427 432 if (out_ep) { … … 433 438 return EOK; 434 439 drop: 440 /* Bus reference */ 435 441 endpoint_del_ref(ep); 436 return err;442 return EINVAL; 437 443 } 438 444 -
uspace/srv/devman/devtree.c
rc483fca rc742954 144 144 } 145 145 146 if (!insert_fun_node(tree, fun, str_dup(""), NULL)) { 147 fun_del_ref(fun); /* fun is destroyed */ 148 fibril_rwlock_write_unlock(&tree->rwlock); 149 return false; 150 } 146 fun_add_ref(fun); 147 insert_fun_node(tree, fun, str_dup(""), NULL); 151 148 152 149 match_id_t *id = create_match_id(); … … 165 162 } 166 163 164 dev_add_ref(dev); 167 165 insert_dev_node(tree, dev, fun); 168 166 -
uspace/srv/devman/driver.c
rc483fca rc742954 462 462 list_remove(&dev->driver_devices); 463 463 fibril_mutex_unlock(&driver->driver_mutex); 464 /* Give an extra reference to driver_reassign_fibril */465 dev_add_ref(dev);466 464 fid_t fid = fibril_create(driver_reassign_fibril, dev); 467 465 if (fid == 0) { 468 466 log_msg(LOG_DEFAULT, LVL_ERROR, 469 467 "Error creating fibril to assign driver."); 470 dev_del_ref(dev);471 468 } 472 469 fibril_add_ready(fid); -
uspace/srv/devman/drv_conn.c
rc483fca rc742954 284 284 285 285 fun_node_t *fun = create_fun_node(); 286 /* 287 * Hold a temporary reference while we work with fun. The reference from 288 * create_fun_node() moves to the device tree. 289 */ 286 /* One reference for creation, one for us */ 287 fun_add_ref(fun); 290 288 fun_add_ref(fun); 291 289 fun->ftype = ftype; … … 302 300 fun_busy_unlock(fun); 303 301 fun_del_ref(fun); 304 fun_del_ref(fun); /* fun is destroyed */302 delete_fun_node(fun); 305 303 async_answer_0(call, ENOMEM); 306 304 return; -
uspace/srv/devman/fun.c
rc483fca rc742954 317 317 318 318 insert_dev_node(&device_tree, dev, fun); 319 dev_add_ref(dev); 319 320 } 320 321
Note:
See TracChangeset
for help on using the changeset viewer.