Changeset 19b3cc6 in mainline for uspace/app


Ignore:
Timestamp:
2014-01-17T23:12:10Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
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.
Message:

Merge libdrv-cleanup branch (includes mainline changes)

Location:
uspace/app
Files:
6 edited
2 moved

Legend:

Unmodified
Added
Removed
  • uspace/app/init/init.c

    rfddffb2 r19b3cc6  
    336336                srv_start("/srv/tmpfs");
    337337       
     338        srv_start("/srv/klog");
    338339        srv_start("/srv/locfs");
    339340        srv_start("/srv/taskmon");
  • uspace/app/kio/Makefile

    rfddffb2 r19b3cc6  
    3131LIBS = $(LIBCLUI_PREFIX)/libclui.a
    3232EXTRA_CFLAGS = -I$(LIBCLUI_PREFIX)
    33 BINARY = klog
     33BINARY = kio
    3434
    3535SOURCES = \
    36         klog.c
     36        kio.c
    3737
    3838include $(USPACE_PREFIX)/Makefile.common
  • uspace/app/kio/kio.c

    rfddffb2 r19b3cc6  
    2727 */
    2828
    29 /** @addtogroup klog KLog
    30  * @brief HelenOS KLog
     29/** @addtogroup kio KIO
     30 * @brief HelenOS KIO
    3131 * @{
    3232 */
     
    4242#include <errno.h>
    4343#include <str_error.h>
    44 #include <io/klog.h>
     44#include <io/kio.h>
    4545#include <sysinfo.h>
    4646#include <malloc.h>
     
    5050#include <tinput.h>
    5151
    52 #define NAME       "klog"
    53 #define LOG_FNAME  "/log/klog"
     52#define NAME       "kio"
     53#define LOG_FNAME  "/log/kio"
    5454
    5555/* Producer/consumer buffers */
     
    6262static prodcons_t pc;
    6363
    64 /* Pointer to klog area */
    65 static wchar_t *klog;
    66 static size_t klog_length;
     64/* Pointer to kio area */
     65static wchar_t *kio;
     66static size_t kio_length;
    6767
    6868/* Notification mutex */
     
    7575 *
    7676 * @param length Number of characters to copy.
    77  * @param data   Pointer to the kernel klog buffer.
     77 * @param data   Pointer to the kernel kio buffer.
    7878 *
    7979 */
     
    142142/** Kernel notification handler
    143143 *
    144  * Receives kernel klog notifications.
     144 * Receives kernel kio notifications.
    145145 *
    146146 * @param callid IPC call ID
     
    156156         * starving.
    157157         *
    158          * Note: Usually the automatic masking of the klog
     158         * Note: Usually the automatic masking of the kio
    159159         * notifications on the kernel side does the trick
    160160         * of limiting the chance of accidentally copying
    161161         * the same data multiple times. However, due to
    162          * the non-blocking architecture of klog notifications,
     162         * the non-blocking architecture of kio notifications,
    163163         * this possibility cannot be generally avoided.
    164164         */
     
    166166        fibril_mutex_lock(&mtx);
    167167       
    168         size_t klog_start = (size_t) IPC_GET_ARG1(*call);
    169         size_t klog_len = (size_t) IPC_GET_ARG2(*call);
    170         size_t klog_stored = (size_t) IPC_GET_ARG3(*call);
    171        
    172         size_t offset = (klog_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;
    173173       
    174174        /* Copy data from the ring buffer */
    175         if (offset + klog_stored >= klog_length) {
    176                 size_t split = klog_length - offset;
    177                
    178                 producer(split, klog + offset);
    179                 producer(klog_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);
    180180        } else
    181                 producer(klog_stored, klog + offset);
    182        
    183         event_unmask(EVENT_KLOG);
     181                producer(kio_stored, kio + offset);
     182       
     183        event_unmask(EVENT_KIO);
    184184        fibril_mutex_unlock(&mtx);
    185185}
     
    188188{
    189189        size_t pages;
    190         int rc = sysinfo_get_value("klog.pages", &pages);
    191         if (rc != EOK) {
    192                 fprintf(stderr, "%s: Unable to get number of klog pages\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",
    193193                    NAME);
    194194                return rc;
     
    196196       
    197197        uintptr_t faddr;
    198         rc = sysinfo_get_value("klog.faddr", &faddr);
    199         if (rc != EOK) {
    200                 fprintf(stderr, "%s: Unable to get klog physical 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",
    201201                    NAME);
    202202                return rc;
     
    204204       
    205205        size_t size = pages * PAGE_SIZE;
    206         klog_length = size / sizeof(wchar_t);
     206        kio_length = size / sizeof(wchar_t);
    207207       
    208208        rc = physmem_map(faddr, pages, AS_AREA_READ | AS_AREA_CACHEABLE,
    209             (void *) &klog);
    210         if (rc != EOK) {
    211                 fprintf(stderr, "%s: Unable to map klog\n", NAME);
     209            (void *) &kio);
     210        if (rc != EOK) {
     211                fprintf(stderr, "%s: Unable to map kio\n", NAME);
    212212                return rc;
    213213        }
     
    215215        prodcons_initialize(&pc);
    216216        async_set_interrupt_received(notification_received);
    217         rc = event_subscribe(EVENT_KLOG, 0);
    218         if (rc != EOK) {
    219                 fprintf(stderr, "%s: Unable to register klog notifications\n",
     217        rc = event_subscribe(EVENT_KIO, 0);
     218        if (rc != EOK) {
     219                fprintf(stderr, "%s: Unable to register kio notifications\n",
    220220                    NAME);
    221221                return rc;
     
    236236
    237237        fibril_add_ready(fid);
    238         event_unmask(EVENT_KLOG);
    239         klog_update();
    240        
    241         tinput_set_prompt(input, "klog> ");
     238        event_unmask(EVENT_KIO);
     239        kio_update();
     240       
     241        tinput_set_prompt(input, "kio> ");
    242242
    243243        char *str;
     
    248248                }
    249249
    250                 klog_command(str, str_size(str));
     250                kio_command(str, str_size(str));
    251251                free(str);
    252252        }
  • uspace/app/trace/syscalls.c

    rfddffb2 r19b3cc6  
    3838
    3939const sc_desc_t syscall_desc[] = {
    40     [SYS_KLOG] ={ "klog",                               3,      V_INT_ERRNO },
     40    [SYS_KIO] ={ "kio",                                 3,      V_INT_ERRNO },
    4141    [SYS_TLS_SET] = { "tls_set",                        1,      V_ERRNO },
    4242
  • uspace/app/vdemo/vdemo.c

    rfddffb2 r19b3cc6  
    110110{
    111111        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");
    113113                if (!main_window) {
    114114                        printf("Cannot open main window.\n");
     
    117117
    118118                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               
    121124                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);
    123126
    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);
    127133                grid_t *grid = create_grid(window_root(main_window), 2, 2, grd_bg);
    128134                if (!lbl_action || !btn_confirm || !btn_cancel || !grid) {
     
    144150                grid->add(grid, &btn_confirm->widget, 0, 1, 1, 1);
    145151                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);
    147154
    148155                window_exec(main_window);
  • uspace/app/viewer/viewer.c

    rfddffb2 r19b3cc6  
    166166        }
    167167       
    168         main_window = window_open(argv[1], true, false, "viewer", 0, 0);
     168        main_window = window_open(argv[1], true, false, "viewer");
    169169        if (!main_window) {
    170170                printf("Cannot open main window.\n");
     
    192192        }
    193193       
    194         window_resize(main_window, WINDOW_WIDTH, WINDOW_HEIGHT);
     194        window_resize(main_window, 0, 0, WINDOW_WIDTH, WINDOW_HEIGHT,
     195            WINDOW_PLACEMENT_ABSOLUTE);
    195196        window_exec(main_window);
    196197       
  • uspace/app/vlaunch/vlaunch.c

    rfddffb2 r19b3cc6  
    115115       
    116116        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");
    118118        if (!main_window) {
    119119                printf("Cannot open main window.\n");
     
    122122       
    123123        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       
    126129        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);
    128131       
    129132        canvas_t *logo_canvas = create_canvas(NULL, LOGO_WIDTH, LOGO_HEIGHT,
    130133            logo);
    131134        label_t *lbl_caption = create_label(NULL, "Launch application:", 16,
    132             lbl_bg, lbl_fg);
     135            lbl_bg, lbl_text);
    133136        button_t *btn_vterm = create_button(NULL, "vterm", 16, btn_bg,
    134             btn_fg);
     137            btn_fg, btn_text);
    135138        button_t *btn_vdemo = create_button(NULL, "vdemo", 16, btn_bg,
    136             btn_fg);
     139            btn_fg, btn_text);
    137140        button_t *btn_vlaunch = create_button(NULL, "vlaunch", 16, btn_bg,
    138             btn_fg);
     141            btn_fg, btn_text);
    139142        grid_t *grid = create_grid(window_root(main_window), 1, 5, grd_bg);
    140143       
     
    156159        grid->add(grid, &btn_vlaunch->widget, 0, 4, 1, 1);
    157160       
    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);
    159163        window_exec(main_window);
    160164       
  • uspace/app/vterm/vterm.c

    rfddffb2 r19b3cc6  
    4949        }
    5050       
    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");
    5252        if (!main_window) {
    5353                printf("%s: Cannot open main window.\n", NAME);
     
    5555        }
    5656       
    57         window_resize(main_window, 650, 510);
     57        window_resize(main_window, 0, 0, 648, 508, WINDOW_PLACEMENT_ANY);
    5858        terminal_t *terminal_widget =
    5959            create_terminal(window_root(main_window), 640, 480);
Note: See TracChangeset for help on using the changeset viewer.