Changes in / [51e5608:b330b309] in mainline
- Files:
-
- 3 added
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
HelenOS.config
r51e5608 rb330b309 417 417 ! [(CONFIG_HID_IN=generic|CONFIG_HID_IN=keyboard)&PLATFORM=ia64&MACHINE=i460GX] CONFIG_PC_KBD (y/n) 418 418 419 % PC keyboard support420 ! [(CONFIG_HID_IN=generic|CONFIG_HID_IN=keyboard)&PLATFORM=arm32&MACHINE=integratorcp] CONFIG_PC_KBD (y/n)421 422 419 % Support for msim/GXemul keyboard 423 420 ! [CONFIG_HID_IN=generic&PLATFORM=mips32] CONFIG_MIPS_KBD (y/n) -
kernel/arch/arm32/src/mach/integratorcp/integratorcp.c
r51e5608 rb330b309 292 292 .y = 480, 293 293 .scan = 2560, 294 .visual = VISUAL_ RGB_8_8_8_0,294 .visual = VISUAL_BGR_0_8_8_8, 295 295 }; 296 296 -
kernel/arch/mips32/include/cp0.h
r51e5608 rb330b309 70 70 { \ 71 71 uint32_t retval; \ 72 asm volatile("mfc0 %0, $" #reg : "=r"(retval)); \72 asm("mfc0 %0, $" #reg : "=r"(retval)); \ 73 73 return retval; \ 74 74 } … … 76 76 #define GEN_WRITE_CP0(nm,reg) static inline void cp0_ ##nm##_write(uint32_t val) \ 77 77 { \ 78 asm volatile("mtc0 %0, $" #reg : : "r"(val) ); \78 asm("mtc0 %0, $" #reg : : "r"(val) ); \ 79 79 } 80 80 -
kernel/arch/sparc64/src/smp/sun4v/smp.c
r51e5608 rb330b309 1 1 /* 2 2 * Copyright (c) 2006 Jakub Jermar 3 * Copyright (c) 2009 Pavel Rimsky 3 * Copyright (c) 2009 Pavel Rimsky 4 4 * All rights reserved. 5 5 * … … 439 439 if (waitq_sleep_timeout(&ap_completion_wq, 10000000, SYNCH_FLAGS_NONE) == 440 440 ESYNCH_TIMEOUT) 441 printf("%s: waiting for processor (cpuid = %" PRIu 64") timed out\n",441 printf("%s: waiting for processor (cpuid = %" PRIu32 ") timed out\n", 442 442 __func__, cpuid); 443 443 -
kernel/arch/sparc64/src/sun4v/start.S
r51e5608 rb330b309 296 296 * Create the first stack frame. 297 297 */ 298 save %sp, -(STACK_WIND OW_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE), %sp298 save %sp, -(STACK_WINDWO_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE), %sp 299 299 flushw 300 300 add %g0, -STACK_BIAS, %fp -
kernel/arch/sparc64/src/trap/sun4v/interrupt.c
r51e5608 rb330b309 111 111 ((void (*)(void)) data1)(); 112 112 } else { 113 printf("Spurious interrupt on % " PRIu64 ", data = %" PRIx64 ".\n",113 printf("Spurious interrupt on %d, data = %" PRIx64 ".\n", 114 114 CPU->arch.id, data1); 115 115 } -
kernel/genarch/Makefile.inc
r51e5608 rb330b309 122 122 endif 123 123 124 ifeq ($(CONFIG_PL050),y) 125 GENARCH_SOURCES += \ 126 genarch/src/kbrd/kbrd_pl050.c \ 127 genarch/src/kbrd/scanc_pl050.c 128 endif 129 124 130 ifeq ($(CONFIG_MAC_KBD),y) 125 131 GENARCH_SOURCES += \ -
uspace/app/bdsh/cmds/modules/cat/cat.c
r51e5608 rb330b309 1 1 /* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> 2 * Copyright (c) 2011, Martin Sucha3 2 * All rights reserved. 4 3 * … … 36 35 #include <str.h> 37 36 #include <fcntl.h> 38 #include <io/console.h>39 #include <io/color.h>40 #include <io/style.h>41 #include <io/keycode.h>42 #include <errno.h>43 #include <vfs/vfs.h>44 #include <assert.h>45 37 46 38 #include "config.h" … … 56 48 57 49 static const char *cat_oops = "That option is not yet supported\n"; 58 static const char *hexchars = "0123456789abcdef";59 60 static bool paging_enabled = false;61 static size_t chars_remaining = 0;62 static size_t lines_remaining = 0;63 static sysarg_t console_cols = 0;64 static sysarg_t console_rows = 0;65 static bool should_quit = false;66 50 67 51 static struct option const long_options[] = { … … 72 56 { "buffer", required_argument, 0, 'b' }, 73 57 { "more", no_argument, 0, 'm' }, 74 { "hex", no_argument, 0, 'x' },75 58 { 0, 0, 0, 0 } 76 59 }; … … 92 75 " -b, --buffer ## Set the read buffer size to ##\n" 93 76 " -m, --more Pause after each screen full\n" 94 " -x, --hex Print bytes as hex values\n"95 77 "Currently, %s is under development, some options don't work.\n", 96 78 cmdname, cmdname); … … 100 82 } 101 83 102 static void waitprompt() 103 { 104 console_set_pos(fphone(stdout), 0, console_rows-1); 105 console_set_color(fphone(stdout), COLOR_BLUE, COLOR_WHITE, 0); 106 printf("ENTER/SPACE/PAGE DOWN - next page, " 107 "ESC/Q - quit, C - continue unpaged"); 108 fflush(stdout); 109 console_set_style(fphone(stdout), STYLE_NORMAL); 110 } 111 112 static void waitkey() 113 { 114 console_event_t ev; 115 116 while (true) { 117 if (!console_get_event(fphone(stdin), &ev)) { 118 return; 119 } 120 if (ev.type == KEY_PRESS) { 121 if (ev.key == KC_ESCAPE || ev.key == KC_Q) { 122 should_quit = true; 123 return; 124 } 125 if (ev.key == KC_C) { 126 paging_enabled = false; 127 return; 128 } 129 if (ev.key == KC_ENTER || ev.key == KC_SPACE || 130 ev.key == KC_PAGE_DOWN) { 131 return; 132 } 133 } 134 } 135 assert(false); 136 } 137 138 static void newpage() 139 { 140 console_clear(fphone(stdout)); 141 chars_remaining = console_cols; 142 lines_remaining = console_rows-1; 143 } 144 145 static void paged_char(wchar_t c) 146 { 147 putchar(c); 148 if (paging_enabled) { 149 chars_remaining--; 150 if (c == '\n' || chars_remaining == 0) { 151 chars_remaining = console_cols; 152 lines_remaining--; 153 } 154 if (lines_remaining == 0) { 155 fflush(stdout); 156 waitprompt(); 157 waitkey(); 158 newpage(); 159 } 160 } 161 } 162 163 static unsigned int cat_file(const char *fname, size_t blen, bool hex) 84 static unsigned int cat_file(const char *fname, size_t blen) 164 85 { 165 86 int fd, bytes = 0, count = 0, reads = 0; 166 87 off64_t total = 0; 167 88 char *buff = NULL; 168 int i;169 size_t offset = 0;170 89 171 90 fd = open(fname, O_RDONLY); … … 190 109 count += bytes; 191 110 buff[bytes] = '\0'; 192 offset = 0; 193 for (i = 0; i < bytes && !should_quit; i++) { 194 if (hex) { 195 paged_char(hexchars[((uint8_t)buff[i])/16]); 196 paged_char(hexchars[((uint8_t)buff[i])%16]); 197 } 198 else { 199 wchar_t c = str_decode(buff, &offset, bytes); 200 if (c == 0) { 201 // reached end of string 202 break; 203 } 204 paged_char(c); 205 } 206 207 } 111 printf("%s", buff); 208 112 reads++; 209 113 } 210 } while (bytes > 0 && !should_quit);114 } while (bytes > 0); 211 115 212 116 close(fd); … … 227 131 unsigned int argc, i, ret = 0, buffer = 0; 228 132 int c, opt_ind; 229 bool hex = false;230 bool more = false;231 sysarg_t rows, cols;232 int rc;233 234 // reset global state235 // TODO: move to structure?236 paging_enabled = false;237 chars_remaining = 0;238 lines_remaining = 0;239 console_cols = 0;240 console_rows = 0;241 should_quit = false;242 133 243 134 argc = cli_count_args(argv); 244 135 245 136 for (c = 0, optind = 0, opt_ind = 0; c != -1;) { 246 c = getopt_long(argc, argv, " xhvmH:t:b:", long_options, &opt_ind);137 c = getopt_long(argc, argv, "hvmH:t:b:", long_options, &opt_ind); 247 138 switch (c) { 248 139 case 'h': … … 262 153 break; 263 154 case 'm': 264 more = true; 265 break; 266 case 'x': 267 hex = true; 268 break; 155 printf("%s", cat_oops); 156 return CMD_FAILURE; 269 157 } 270 158 } … … 280 168 if (buffer <= 0) 281 169 buffer = CAT_DEFAULT_BUFLEN; 282 283 if (more) {284 rc = console_get_size(fphone(stdout), &cols, &rows);285 if (rc != EOK) {286 printf("%s - cannot get console size\n", cmdname);287 return CMD_FAILURE;288 }289 console_cols = cols;290 console_rows = rows;291 paging_enabled = true;292 newpage();293 }294 170 295 for (i = optind; argv[i] != NULL && !should_quit; i++)296 ret += cat_file(argv[i], buffer , hex);171 for (i = optind; argv[i] != NULL; i++) 172 ret += cat_file(argv[i], buffer); 297 173 298 174 if (ret) -
uspace/app/bdsh/cmds/modules/cat/cat.h
r51e5608 rb330b309 4 4 /* Prototypes for the cat command, excluding entry points */ 5 5 6 static unsigned int cat_file(const char *, size_t , bool);6 static unsigned int cat_file(const char *, size_t); 7 7 8 8 #endif /* CAT_H */ -
uspace/app/bdsh/cmds/modules/cp/cp.c
r51e5608 rb330b309 108 108 for (;;) { 109 109 ssize_t res; 110 size_t written = 0;111 110 112 111 bytes = read(fd1, buff, blen); … … 121 120 * returned less data than requested. 122 121 */ 123 bytes = write(fd2, buff + written, res);122 bytes = write(fd2, buff, res); 124 123 if (bytes < 0) 125 124 goto err; 126 written += bytes;127 125 res -= bytes; 128 126 } while (res > 0); -
uspace/app/bdsh/cmds/modules/rm/rm.c
r51e5608 rb330b309 101 101 } 102 102 103 static unsigned int rm_recursive_not_empty_dirs(const char *path)104 {105 DIR *dirp;106 struct dirent *dp;107 char buff[PATH_MAX];108 unsigned int scope;109 unsigned int ret = 0;110 111 dirp = opendir(path);112 if (!dirp) {113 /* May have been deleted between scoping it and opening it */114 cli_error(CL_EFAIL, "Could not open %s", path);115 return ret;116 }117 118 memset(buff, 0, sizeof(buff));119 while ((dp = readdir(dirp))) {120 snprintf(buff, PATH_MAX - 1, "%s/%s", path, dp->d_name);121 scope = rm_scope(buff);122 switch (scope) {123 case RM_BOGUS:124 break;125 case RM_FILE:126 ret += rm_single(buff);127 break;128 case RM_DIR:129 ret += rm_recursive(buff);130 break;131 }132 }133 134 return ret;135 }136 137 103 static unsigned int rm_recursive(const char *path) 138 104 { 139 105 int rc; 140 unsigned int ret = 0;141 106 142 107 /* First see if it will just go away */ … … 146 111 147 112 /* Its not empty, recursively scan it */ 148 ret = rm_recursive_not_empty_dirs(path); 149 150 /* Delete directory */ 151 rc = rmdir(path); 152 if (rc == 0) 153 return ret; 154 155 cli_error(CL_ENOTSUP, "Can not remove %s", path); 156 157 return ret + 1; 113 cli_error(CL_ENOTSUP, 114 "Can not remove %s, directory not empty", path); 115 return 1; 158 116 } 159 117 -
uspace/drv/pciintel/pci.c
r51e5608 rb330b309 95 95 sysarg_t i8259; 96 96 97 int irc_phone = ENOTSUP; 98 99 if (((sysinfo_get_value("apic", &apic) == EOK) && (apic)) 100 || ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259))) { 101 irc_phone = service_connect_blocking(SERVICE_IRC, 0, 0); 102 } 103 97 int irc_phone = -1; 98 int irc_service = -1; 99 100 if ((sysinfo_get_value("apic", &apic) == EOK) && (apic)) { 101 irc_service = SERVICE_APIC; 102 } else if ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259)) { 103 irc_service = SERVICE_I8259; 104 } 105 106 if (irc_service == -1) { 107 return false; 108 } 109 110 irc_phone = service_connect_blocking(irc_service, 0, 0); 104 111 if (irc_phone < 0) { 105 112 return false; -
uspace/lib/c/include/ipc/services.h
r51e5608 rb330b309 47 47 SERVICE_DEVMAP, 48 48 SERVICE_DEVMAN, 49 SERVICE_IRC, 49 SERVICE_FHC, 50 SERVICE_OBIO, 51 SERVICE_APIC, 52 SERVICE_I8259, 50 53 SERVICE_CLIPBOARD, 51 54 SERVICE_NETWORKING, -
uspace/lib/fs/libfs.c
r51e5608 rb330b309 391 391 if (lflag & L_CREATE) 392 392 (void) ops->destroy(fn); 393 else394 (void) ops->node_put(fn);395 393 async_answer_0(rid, rc); 396 394 } else { … … 475 473 if (lflag & L_CREATE) 476 474 (void) ops->destroy(fn); 477 else478 (void) ops->node_put(fn);479 475 async_answer_0(rid, rc); 480 476 } else { -
uspace/srv/hid/kbd/Makefile
r51e5608 rb330b309 78 78 SOURCES += \ 79 79 port/pl050.c \ 80 ctl/p c.c80 ctl/pl050.c 81 81 endif 82 82 endif -
uspace/srv/hid/kbd/generic/kbd.c
r51e5608 rb330b309 67 67 static unsigned lock_keys; 68 68 69 bool irc_service = false;70 int irc_phone = -1;69 int cir_service = 0; 70 int cir_phone = -1; 71 71 72 72 #define NUM_LAYOUTS 3 … … 216 216 sysarg_t obio; 217 217 218 if (((sysinfo_get_value("kbd.cir.fhc", &fhc) == EOK) && (fhc)) 219 || ((sysinfo_get_value("kbd.cir.obio", &obio) == EOK) && (obio))) 220 irc_service = true; 221 222 if (irc_service) { 223 while (irc_phone < 0) 224 irc_phone = service_connect_blocking(SERVICE_IRC, 0, 0); 218 if ((sysinfo_get_value("kbd.cir.fhc", &fhc) == EOK) && (fhc)) 219 cir_service = SERVICE_FHC; 220 else if ((sysinfo_get_value("kbd.cir.obio", &obio) == EOK) && (obio)) 221 cir_service = SERVICE_OBIO; 222 223 if (cir_service) { 224 while (cir_phone < 0) 225 cir_phone = service_connect_blocking(cir_service, 0, 0); 225 226 } 226 227 -
uspace/srv/hid/kbd/include/kbd.h
r51e5608 rb330b309 38 38 #define KBD_KBD_H_ 39 39 40 #include <bool.h> 41 42 extern bool irc_service; 43 extern int irc_phone; 40 extern int cir_service; 41 extern int cir_phone; 44 42 45 43 extern void kbd_push_scancode(int); -
uspace/srv/hid/kbd/port/ns16550.c
r51e5608 rb330b309 120 120 kbd_push_scancode(scan_code); 121 121 122 if ( irc_service)123 async_msg_1( irc_phone, IRC_CLEAR_INTERRUPT,122 if (cir_service) 123 async_msg_1(cir_phone, IRC_CLEAR_INTERRUPT, 124 124 IPC_GET_IMETHOD(*call)); 125 125 } -
uspace/srv/hid/kbd/port/z8530.c
r51e5608 rb330b309 108 108 kbd_push_scancode(scan_code); 109 109 110 if ( irc_service)111 async_msg_1( irc_phone, IRC_CLEAR_INTERRUPT,110 if (cir_service) 111 async_msg_1(cir_phone, IRC_CLEAR_INTERRUPT, 112 112 IPC_GET_IMETHOD(*call)); 113 113 } -
uspace/srv/hw/irc/apic/apic.c
r51e5608 rb330b309 54 54 #define NAME "apic" 55 55 56 static bool apic_found = false; 57 56 58 static int apic_enable_irq(sysarg_t irq) 57 59 { … … 79 81 callid = async_get_call(&call); 80 82 81 switch (IPC_GET_IMETHOD(call)) { 83 sysarg_t method = IPC_GET_IMETHOD(call); 84 if (method == IPC_M_PHONE_HUNGUP) { 85 return; 86 } 87 88 if (!apic_found) { 89 async_answer_0(callid, ENOTSUP); 90 break; 91 } 92 93 switch (method) { 82 94 case IRC_ENABLE_INTERRUPT: 83 95 async_answer_0(callid, apic_enable_irq(IPC_GET_ARG1(call))); … … 97 109 * 98 110 */ 99 static boolapic_init(void)111 static void apic_init(void) 100 112 { 101 113 sysarg_t apic; 102 114 103 if ((sysinfo_get_value("apic", &apic) != EOK) || (!apic)) {104 printf(NAME ": No APIC found\n");105 return false;115 apic_found = sysinfo_get_value("apic", &apic) && apic; 116 if (!apic_found) { 117 printf(NAME ": Warning: no APIC found\n"); 106 118 } 107 119 108 120 async_set_client_connection(apic_connection); 109 service_register(SERVICE_IRC); 110 111 return true; 121 service_register(SERVICE_APIC); 112 122 } 113 123 … … 116 126 printf(NAME ": HelenOS APIC driver\n"); 117 127 118 if (!apic_init()) 119 return -1; 120 128 apic_init(); 129 121 130 printf(NAME ": Accepting connections\n"); 122 131 async_manager(); -
uspace/srv/hw/irc/fhc/fhc.c
r51e5608 rb330b309 136 136 137 137 async_set_client_connection(fhc_connection); 138 service_register(SERVICE_ IRC);138 service_register(SERVICE_FHC); 139 139 140 140 return true; -
uspace/srv/hw/irc/i8259/i8259.c
r51e5608 rb330b309 149 149 150 150 async_set_client_connection(i8259_connection); 151 service_register(SERVICE_I RC);151 service_register(SERVICE_I8259); 152 152 153 153 return true; -
uspace/srv/hw/irc/obio/obio.c
r51e5608 rb330b309 137 137 138 138 async_set_client_connection(obio_connection); 139 service_register(SERVICE_ IRC);139 service_register(SERVICE_OBIO); 140 140 141 141 return true; -
uspace/srv/hw/netif/ne2000/ne2000.c
r51e5608 rb330b309 75 75 #define IRQ_GET_TSR(call) ((int) IPC_GET_ARG3(call)) 76 76 77 static bool irc_service = false;77 static int irc_service = 0; 78 78 static int irc_phone = -1; 79 79 … … 383 383 sysarg_t i8259; 384 384 385 if (((sysinfo_get_value("apic", &apic) == EOK) && (apic)) 386 || ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259))) 387 irc_service = true; 385 if ((sysinfo_get_value("apic", &apic) == EOK) && (apic)) 386 irc_service = SERVICE_APIC; 387 else if ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259)) 388 irc_service = SERVICE_I8259; 388 389 389 390 if (irc_service) { 390 391 while (irc_phone < 0) 391 irc_phone = service_connect_blocking( SERVICE_IRC, 0, 0);392 irc_phone = service_connect_blocking(irc_service, 0, 0); 392 393 } 393 394 -
uspace/srv/net/net/net.c
r51e5608 rb330b309 289 289 if (rc != EOK) 290 290 return rc; 291 292 291 rc = add_module(NULL, &net_globals.modules, (uint8_t *) NE2000_NAME, 293 292 (uint8_t *) NE2000_FILENAME, SERVICE_NE2000, 0, connect_to_service); 294 293 if (rc != EOK) 295 294 return rc; 296 297 295 rc = add_module(NULL, &net_globals.modules, (uint8_t *) ETHERNET_NAME, 298 296 (uint8_t *) ETHERNET_FILENAME, SERVICE_ETHERNET, 0, connect_to_service); 299 297 if (rc != EOK) 300 298 return rc; 301 302 299 rc = add_module(NULL, &net_globals.modules, (uint8_t *) NILDUMMY_NAME, 303 300 (uint8_t *) NILDUMMY_FILENAME, SERVICE_NILDUMMY, 0, connect_to_service); … … 593 590 rc = start_device(netif); 594 591 if (rc != EOK) { 595 printf("%s: Ignoring failedinterface %s (%s)\n", NAME,592 printf("%s: Error starting interface %s (%s)\n", NAME, 596 593 netif->name, str_error(rc)); 597 594 measured_strings_destroy(&netif->configuration); 598 595 netifs_exclude_index(&net_globals.netifs, index); 599 continue; 596 597 return rc; 600 598 } 601 599 -
uspace/srv/vfs/vfs_ops.c
r51e5608 rb330b309 1234 1234 if (!parentc) { 1235 1235 fibril_rwlock_write_unlock(&namespace_rwlock); 1236 vfs_node_put(old_node);1237 1236 async_answer_0(rid, rc); 1238 1237 free(old); … … 1252 1251 if (rc != EOK) { 1253 1252 fibril_rwlock_write_unlock(&namespace_rwlock); 1254 vfs_node_put(old_node);1255 1253 async_answer_0(rid, rc); 1256 1254 free(old); … … 1263 1261 (old_node->devmap_handle != new_par_lr.triplet.devmap_handle)) { 1264 1262 fibril_rwlock_write_unlock(&namespace_rwlock); 1265 vfs_node_put(old_node);1266 1263 async_answer_0(rid, EXDEV); /* different file systems */ 1267 1264 free(old); … … 1282 1279 if (!new_node) { 1283 1280 fibril_rwlock_write_unlock(&namespace_rwlock); 1284 vfs_node_put(old_node);1285 1281 async_answer_0(rid, ENOMEM); 1286 1282 free(old); … … 1294 1290 default: 1295 1291 fibril_rwlock_write_unlock(&namespace_rwlock); 1296 vfs_node_put(old_node);1297 1292 async_answer_0(rid, ENOTEMPTY); 1298 1293 free(old); … … 1305 1300 if (rc != EOK) { 1306 1301 fibril_rwlock_write_unlock(&namespace_rwlock); 1307 vfs_node_put(old_node);1308 1302 if (new_node) 1309 1303 vfs_node_put(new_node); -
version
r51e5608 rb330b309 37 37 VERSION = 0 38 38 PATCHLEVEL = 4 39 SUBLEVEL = 339 SUBLEVEL = 2 40 40 41 41 ifdef EXTRAVERSION … … 45 45 endif 46 46 47 NAME = S ashimi47 NAME = Skewer
Note:
See TracChangeset
for help on using the changeset viewer.