Changeset 19b3cc6 in mainline for uspace/app
- Timestamp:
- 2014-01-17T23:12:10Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e26a9d95
- Parents:
- fddffb2 (diff), facc34d (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. - Location:
- uspace/app
- Files:
-
- 6 edited
- 2 moved
-
init/init.c (modified) (1 diff)
-
kio/Makefile (moved) (moved from uspace/app/klog/Makefile ) (1 diff)
-
kio/kio.c (moved) (moved from uspace/app/klog/klog.c ) (14 diffs)
-
trace/syscalls.c (modified) (1 diff)
-
vdemo/vdemo.c (modified) (3 diffs)
-
viewer/viewer.c (modified) (2 diffs)
-
vlaunch/vlaunch.c (modified) (3 diffs)
-
vterm/vterm.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/init/init.c
rfddffb2 r19b3cc6 336 336 srv_start("/srv/tmpfs"); 337 337 338 srv_start("/srv/klog"); 338 339 srv_start("/srv/locfs"); 339 340 srv_start("/srv/taskmon"); -
uspace/app/kio/Makefile
rfddffb2 r19b3cc6 31 31 LIBS = $(LIBCLUI_PREFIX)/libclui.a 32 32 EXTRA_CFLAGS = -I$(LIBCLUI_PREFIX) 33 BINARY = k log33 BINARY = kio 34 34 35 35 SOURCES = \ 36 k log.c36 kio.c 37 37 38 38 include $(USPACE_PREFIX)/Makefile.common -
uspace/app/kio/kio.c
rfddffb2 r19b3cc6 27 27 */ 28 28 29 /** @addtogroup k log KLog30 * @brief HelenOS K Log29 /** @addtogroup kio KIO 30 * @brief HelenOS KIO 31 31 * @{ 32 32 */ … … 42 42 #include <errno.h> 43 43 #include <str_error.h> 44 #include <io/k log.h>44 #include <io/kio.h> 45 45 #include <sysinfo.h> 46 46 #include <malloc.h> … … 50 50 #include <tinput.h> 51 51 52 #define NAME "k log"53 #define LOG_FNAME "/log/k log"52 #define NAME "kio" 53 #define LOG_FNAME "/log/kio" 54 54 55 55 /* Producer/consumer buffers */ … … 62 62 static prodcons_t pc; 63 63 64 /* Pointer to k logarea */65 static wchar_t *k log;66 static size_t k log_length;64 /* Pointer to kio area */ 65 static wchar_t *kio; 66 static size_t kio_length; 67 67 68 68 /* Notification mutex */ … … 75 75 * 76 76 * @param length Number of characters to copy. 77 * @param data Pointer to the kernel k logbuffer.77 * @param data Pointer to the kernel kio buffer. 78 78 * 79 79 */ … … 142 142 /** Kernel notification handler 143 143 * 144 * Receives kernel k lognotifications.144 * Receives kernel kio notifications. 145 145 * 146 146 * @param callid IPC call ID … … 156 156 * starving. 157 157 * 158 * Note: Usually the automatic masking of the k log158 * Note: Usually the automatic masking of the kio 159 159 * notifications on the kernel side does the trick 160 160 * of limiting the chance of accidentally copying 161 161 * the same data multiple times. However, due to 162 * the non-blocking architecture of k lognotifications,162 * the non-blocking architecture of kio notifications, 163 163 * this possibility cannot be generally avoided. 164 164 */ … … 166 166 fibril_mutex_lock(&mtx); 167 167 168 size_t k log_start = (size_t) IPC_GET_ARG1(*call);169 size_t k log_len = (size_t) IPC_GET_ARG2(*call);170 size_t k log_stored = (size_t) IPC_GET_ARG3(*call);171 172 size_t offset = (k log_start + klog_len - klog_stored) % klog_length;168 size_t kio_start = (size_t) IPC_GET_ARG1(*call); 169 size_t kio_len = (size_t) IPC_GET_ARG2(*call); 170 size_t kio_stored = (size_t) IPC_GET_ARG3(*call); 171 172 size_t offset = (kio_start + kio_len - kio_stored) % kio_length; 173 173 174 174 /* Copy data from the ring buffer */ 175 if (offset + k log_stored >= klog_length) {176 size_t split = k log_length - offset;177 178 producer(split, k log+ offset);179 producer(k log_stored - split, klog);175 if (offset + kio_stored >= kio_length) { 176 size_t split = kio_length - offset; 177 178 producer(split, kio + offset); 179 producer(kio_stored - split, kio); 180 180 } else 181 producer(k log_stored, klog+ offset);182 183 event_unmask(EVENT_K LOG);181 producer(kio_stored, kio + offset); 182 183 event_unmask(EVENT_KIO); 184 184 fibril_mutex_unlock(&mtx); 185 185 } … … 188 188 { 189 189 size_t pages; 190 int rc = sysinfo_get_value("k log.pages", &pages);191 if (rc != EOK) { 192 fprintf(stderr, "%s: Unable to get number of k logpages\n",190 int rc = sysinfo_get_value("kio.pages", &pages); 191 if (rc != EOK) { 192 fprintf(stderr, "%s: Unable to get number of kio pages\n", 193 193 NAME); 194 194 return rc; … … 196 196 197 197 uintptr_t faddr; 198 rc = sysinfo_get_value("k log.faddr", &faddr);199 if (rc != EOK) { 200 fprintf(stderr, "%s: Unable to get k logphysical address\n",198 rc = sysinfo_get_value("kio.faddr", &faddr); 199 if (rc != EOK) { 200 fprintf(stderr, "%s: Unable to get kio physical address\n", 201 201 NAME); 202 202 return rc; … … 204 204 205 205 size_t size = pages * PAGE_SIZE; 206 k log_length = size / sizeof(wchar_t);206 kio_length = size / sizeof(wchar_t); 207 207 208 208 rc = physmem_map(faddr, pages, AS_AREA_READ | AS_AREA_CACHEABLE, 209 (void *) &k log);210 if (rc != EOK) { 211 fprintf(stderr, "%s: Unable to map k log\n", NAME);209 (void *) &kio); 210 if (rc != EOK) { 211 fprintf(stderr, "%s: Unable to map kio\n", NAME); 212 212 return rc; 213 213 } … … 215 215 prodcons_initialize(&pc); 216 216 async_set_interrupt_received(notification_received); 217 rc = event_subscribe(EVENT_K LOG, 0);218 if (rc != EOK) { 219 fprintf(stderr, "%s: Unable to register k lognotifications\n",217 rc = event_subscribe(EVENT_KIO, 0); 218 if (rc != EOK) { 219 fprintf(stderr, "%s: Unable to register kio notifications\n", 220 220 NAME); 221 221 return rc; … … 236 236 237 237 fibril_add_ready(fid); 238 event_unmask(EVENT_K LOG);239 k log_update();240 241 tinput_set_prompt(input, "k log> ");238 event_unmask(EVENT_KIO); 239 kio_update(); 240 241 tinput_set_prompt(input, "kio> "); 242 242 243 243 char *str; … … 248 248 } 249 249 250 k log_command(str, str_size(str));250 kio_command(str, str_size(str)); 251 251 free(str); 252 252 } -
uspace/app/trace/syscalls.c
rfddffb2 r19b3cc6 38 38 39 39 const sc_desc_t syscall_desc[] = { 40 [SYS_K LOG] ={ "klog",3, V_INT_ERRNO },40 [SYS_KIO] ={ "kio", 3, V_INT_ERRNO }, 41 41 [SYS_TLS_SET] = { "tls_set", 1, V_ERRNO }, 42 42 -
uspace/app/vdemo/vdemo.c
rfddffb2 r19b3cc6 110 110 { 111 111 if (argc >= 2) { 112 window_t *main_window = window_open(argv[1], true, true, "vdemo" , 0, 0);112 window_t *main_window = window_open(argv[1], true, true, "vdemo"); 113 113 if (!main_window) { 114 114 printf("Cannot open main window.\n"); … … 117 117 118 118 pixel_t grd_bg = PIXEL(255, 240, 240, 240); 119 pixel_t btn_bg = PIXEL(255, 0, 0, 0); 120 pixel_t btn_fg = PIXEL(255, 240, 240, 240); 119 120 pixel_t btn_bg = PIXEL(255, 240, 240, 240); 121 pixel_t btn_fg = PIXEL(255, 186, 186, 186); 122 pixel_t btn_text = PIXEL(255, 0, 0, 0); 123 121 124 pixel_t lbl_bg = PIXEL(255, 240, 240, 240); 122 pixel_t lbl_ fg= PIXEL(255, 0, 0, 0);125 pixel_t lbl_text = PIXEL(255, 0, 0, 0); 123 126 124 my_label_t *lbl_action = create_my_label(NULL, "Hello there!", 16, lbl_bg, lbl_fg); 125 button_t *btn_confirm = create_button(NULL, "Confirm", 16, btn_bg, btn_fg); 126 button_t *btn_cancel = create_button(NULL, "Cancel", 16, btn_bg, btn_fg); 127 my_label_t *lbl_action = create_my_label(NULL, "Hello there!", 16, 128 lbl_bg, lbl_text); 129 button_t *btn_confirm = create_button(NULL, "Confirm", 16, btn_bg, 130 btn_fg, btn_text); 131 button_t *btn_cancel = create_button(NULL, "Cancel", 16, btn_bg, 132 btn_fg, btn_text); 127 133 grid_t *grid = create_grid(window_root(main_window), 2, 2, grd_bg); 128 134 if (!lbl_action || !btn_confirm || !btn_cancel || !grid) { … … 144 150 grid->add(grid, &btn_confirm->widget, 0, 1, 1, 1); 145 151 grid->add(grid, &btn_cancel->widget, 1, 1, 1, 1); 146 window_resize(main_window, 200, 76); 152 window_resize(main_window, 0, 0, 200, 76, 153 WINDOW_PLACEMENT_CENTER); 147 154 148 155 window_exec(main_window); -
uspace/app/viewer/viewer.c
rfddffb2 r19b3cc6 166 166 } 167 167 168 main_window = window_open(argv[1], true, false, "viewer" , 0, 0);168 main_window = window_open(argv[1], true, false, "viewer"); 169 169 if (!main_window) { 170 170 printf("Cannot open main window.\n"); … … 192 192 } 193 193 194 window_resize(main_window, WINDOW_WIDTH, WINDOW_HEIGHT); 194 window_resize(main_window, 0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, 195 WINDOW_PLACEMENT_ABSOLUTE); 195 196 window_exec(main_window); 196 197 -
uspace/app/vlaunch/vlaunch.c
rfddffb2 r19b3cc6 115 115 116 116 winreg = argv[1]; 117 window_t *main_window = window_open(argv[1], true, true, "vlaunch" , 0, 0);117 window_t *main_window = window_open(argv[1], true, true, "vlaunch"); 118 118 if (!main_window) { 119 119 printf("Cannot open main window.\n"); … … 122 122 123 123 pixel_t grd_bg = PIXEL(255, 255, 255, 255); 124 pixel_t btn_bg = PIXEL(255, 0, 0, 0); 125 pixel_t btn_fg = PIXEL(255, 240, 240, 240); 124 125 pixel_t btn_bg = PIXEL(255, 255, 255, 255); 126 pixel_t btn_fg = PIXEL(255, 186, 186, 186); 127 pixel_t btn_text = PIXEL(255, 0, 0, 0); 128 126 129 pixel_t lbl_bg = PIXEL(255, 255, 255, 255); 127 pixel_t lbl_ fg= PIXEL(255, 0, 0, 0);130 pixel_t lbl_text = PIXEL(255, 0, 0, 0); 128 131 129 132 canvas_t *logo_canvas = create_canvas(NULL, LOGO_WIDTH, LOGO_HEIGHT, 130 133 logo); 131 134 label_t *lbl_caption = create_label(NULL, "Launch application:", 16, 132 lbl_bg, lbl_ fg);135 lbl_bg, lbl_text); 133 136 button_t *btn_vterm = create_button(NULL, "vterm", 16, btn_bg, 134 btn_fg );137 btn_fg, btn_text); 135 138 button_t *btn_vdemo = create_button(NULL, "vdemo", 16, btn_bg, 136 btn_fg );139 btn_fg, btn_text); 137 140 button_t *btn_vlaunch = create_button(NULL, "vlaunch", 16, btn_bg, 138 btn_fg );141 btn_fg, btn_text); 139 142 grid_t *grid = create_grid(window_root(main_window), 1, 5, grd_bg); 140 143 … … 156 159 grid->add(grid, &btn_vlaunch->widget, 0, 4, 1, 1); 157 160 158 window_resize(main_window, 210, 130 + LOGO_HEIGHT); 161 window_resize(main_window, 0, 0, 210, 130 + LOGO_HEIGHT, 162 WINDOW_PLACEMENT_RIGHT | WINDOW_PLACEMENT_TOP); 159 163 window_exec(main_window); 160 164 -
uspace/app/vterm/vterm.c
rfddffb2 r19b3cc6 49 49 } 50 50 51 window_t *main_window = window_open(argv[1], true, true, "vterm" , 0, 0);51 window_t *main_window = window_open(argv[1], true, true, "vterm"); 52 52 if (!main_window) { 53 53 printf("%s: Cannot open main window.\n", NAME); … … 55 55 } 56 56 57 window_resize(main_window, 650, 510);57 window_resize(main_window, 0, 0, 648, 508, WINDOW_PLACEMENT_ANY); 58 58 terminal_t *terminal_widget = 59 59 create_terminal(window_root(main_window), 640, 480);
Note:
See TracChangeset
for help on using the changeset viewer.
