Changes in / [47f7adfc:b946bf83] in mainline


Ignore:
Files:
20 added
2 deleted
21 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/mips32/src/Makefile

    r47f7adfc rb946bf83  
    3232.PHONY: all clean
    3333
    34 all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h
     34all: ../../../../version ../../../../Makefile.config ../../../../config.h ../../../../config.defs
    3535        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    3636        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3737
    3838clean:
    39         rm -f $(USPACEDIR)/dist/srv/*
    40         rm -f $(USPACEDIR)/dist/app/*
    41         rm -f $(USPACEDIR)/dist/cfg/net/*
    42 
    4339        for file in $(RD_SRVS) ; do \
    4440                rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
     
    4743                rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
    4844        done
    49         for file in $(NET_CFG) ; do \
    50                 rm -f $(USPACEDIR)/dist/cfg/net/`basename $$file` ; \
    51         done
    5245        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(RAW) $(COMPS).h $(COMPS).c $(LINK) $(INITRD).img $(INITRD).fs
    5346        find . -name '*.o' -follow -exec rm \{\} \;
  • boot/arch/mips32/src/Makefile.build

    r47f7adfc rb946bf83  
    3232
    3333include ../../../../version
    34 include ../../../../Makefile.common
    3534include ../../../../Makefile.config
     35include ../../../../config.defs
    3636include Makefile.common
    3737include Makefile.toolchain
     
    7777
    7878$(DEPEND):
    79         rm -f $(USPACEDIR)/dist/srv/*
    80         rm -f $(USPACEDIR)/dist/app/*
    81         rm -f $(USPACEDIR)/dist/cfg/net/*
    82 
    8379        for file in $(RD_SRVS) ; do \
    8480                cp $$file $(USPACEDIR)/dist/srv/ ; \
     
    8682        for file in $(RD_APPS) ; do \
    8783                cp $$file $(USPACEDIR)/dist/app/ ; \
    88         done
    89         for file in $(NET_CFG) ; do \
    90                 cp $$file $(USPACEDIR)/dist/cfg/net/ ; \
    9184        done
    9285ifeq ($(RDFMT),tmpfs)
  • boot/arch/mips32/src/Makefile.toolchain

    r47f7adfc rb946bf83  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
     32ifndef CROSS_PREFIX
     33        CROSS_PREFIX = /usr/local
     34endif
     35
    2936BFD_ARCH = mips
     37TARGET = mipsel-linux-gnu
     38TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips32/bin
    3039
    3140JOBFILE = ../../../../tools/jobfile.py
     
    3948        BFD_NAME = elf32-tradbigmips
    4049        BFD = ecoff-bigmips
     50        TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips32eb/bin
     51        TARGET = mips-linux-gnu
    4152endif
    4253
     
    4455        BFD_NAME = elf32-tradlittlemips
    4556        BFD = binary
     57endif
     58
     59ifeq ($(COMPILER),gcc_native)
     60        CC = gcc
     61        AS = as
     62        LD = ld
     63        OBJCOPY = objcopy
     64        OBJDUMP = objdump
     65endif
     66
     67ifeq ($(COMPILER),gcc_cross)
     68        CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
     69        AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
     70        LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
     71        OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
     72        OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
    4673endif
    4774
  • kernel/arch/mips32/include/cp0.h

    r47f7adfc rb946bf83  
    7070  { \
    7171      uint32_t retval; \
    72       asm volatile ("mfc0 %0, $" #reg : "=r"(retval)); \
     72      asm("mfc0 %0, $" #reg : "=r"(retval)); \
    7373      return retval; \
    7474  }
     
    7676#define GEN_WRITE_CP0(nm,reg) static inline void cp0_ ##nm##_write(uint32_t val) \
    7777 { \
    78     asm volatile ("mtc0 %0, $" #reg : : "r"(val) ); \
     78    asm("mtc0 %0, $" #reg : : "r"(val) ); \
    7979 }
    8080
  • kernel/arch/sparc64/src/smp/sun4v/smp.c

    r47f7adfc rb946bf83  
    11/*
    22 * Copyright (c) 2006 Jakub Jermar
    3  * Copyright (c) 2009 Pavel Rimsky
     3 * Copyright (c) 2009 Pavel Rimsky 
    44 * All rights reserved.
    55 *
     
    439439        if (waitq_sleep_timeout(&ap_completion_wq, 10000000, SYNCH_FLAGS_NONE) ==
    440440            ESYNCH_TIMEOUT)
    441                 printf("%s: waiting for processor (cpuid = %" PRIu64 ") timed out\n",
     441                printf("%s: waiting for processor (cpuid = %" PRIu32 ") timed out\n",
    442442                    __func__, cpuid);
    443443       
  • kernel/arch/sparc64/src/sun4v/start.S

    r47f7adfc rb946bf83  
    296296         * Create the first stack frame.
    297297         */
    298         save %sp, -(STACK_WINDOW_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE), %sp
     298        save %sp, -(STACK_WINDWO_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE), %sp
    299299        flushw
    300300        add %g0, -STACK_BIAS, %fp
  • kernel/arch/sparc64/src/trap/sun4v/interrupt.c

    r47f7adfc rb946bf83  
    111111                        ((void (*)(void)) data1)();
    112112                } else {
    113                         printf("Spurious interrupt on %" PRIu64 ", data = %" PRIx64 ".\n",
     113                        printf("Spurious interrupt on %d, data = %" PRIx64 ".\n",
    114114                            CPU->arch.id, data1);
    115115                }
  • uspace/app/bdsh/cmds/modules/cat/cat.c

    r47f7adfc rb946bf83  
    11/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com>
    2  * Copyright (c) 2011, Martin Sucha
    32 * All rights reserved.
    43 *
     
    3635#include <str.h>
    3736#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>
    4537
    4638#include "config.h"
     
    5648
    5749static 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;
    6650
    6751static struct option const long_options[] = {
     
    7256        { "buffer", required_argument, 0, 'b' },
    7357        { "more", no_argument, 0, 'm' },
    74         { "hex", no_argument, 0, 'x' },
    7558        { 0, 0, 0, 0 }
    7659};
     
    9275                "  -b, --buffer ##  Set the read buffer size to ##\n"
    9376                "  -m, --more       Pause after each screen full\n"
    94                 "  -x, --hex        Print bytes as hex values\n"
    9577                "Currently, %s is under development, some options don't work.\n",
    9678                cmdname, cmdname);
     
    10082}
    10183
    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)
     84static unsigned int cat_file(const char *fname, size_t blen)
    16485{
    16586        int fd, bytes = 0, count = 0, reads = 0;
    16687        off64_t total = 0;
    16788        char *buff = NULL;
    168         int i;
    169         size_t offset = 0;
    17089
    17190        fd = open(fname, O_RDONLY);
     
    190109                        count += bytes;
    191110                        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);
    208112                        reads++;
    209113                }
    210         } while (bytes > 0 && !should_quit);
     114        } while (bytes > 0);
    211115
    212116        close(fd);
     
    227131        unsigned int argc, i, ret = 0, buffer = 0;
    228132        int c, opt_ind;
    229         bool hex = false;
    230         bool more = false;
    231         sysarg_t rows, cols;
    232         int rc;
    233        
    234         // reset global state
    235         // 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;
    242133
    243134        argc = cli_count_args(argv);
    244135
    245136        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);
    247138                switch (c) {
    248139                case 'h':
     
    262153                        break;
    263154                case 'm':
    264                         more = true;
    265                         break;
    266                 case 'x':
    267                         hex = true;
    268                         break;
     155                        printf("%s", cat_oops);
     156                        return CMD_FAILURE;
    269157                }
    270158        }
     
    280168        if (buffer <= 0)
    281169                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         }
    294170
    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);
    297173
    298174        if (ret)
  • uspace/app/bdsh/cmds/modules/cat/cat.h

    r47f7adfc rb946bf83  
    44/* Prototypes for the cat command, excluding entry points */
    55
    6 static unsigned int cat_file(const char *, size_t, bool);
     6static unsigned int cat_file(const char *, size_t);
    77
    88#endif /* CAT_H */
  • uspace/app/bdsh/cmds/modules/rm/rm.c

    r47f7adfc rb946bf83  
    101101}
    102102
    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 
    137103static unsigned int rm_recursive(const char *path)
    138104{
    139105        int rc;
    140         unsigned int ret = 0;
    141106
    142107        /* First see if it will just go away */
     
    146111
    147112        /* 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;
    158116}
    159117
  • uspace/lib/c/include/ipc/services.h

    r47f7adfc rb946bf83  
    4747        SERVICE_DEVMAP,
    4848        SERVICE_DEVMAN,
    49         SERVICE_IRC,
     49        SERVICE_FHC,
     50        SERVICE_OBIO,
     51        SERVICE_APIC,
     52        SERVICE_I8259,
    5053        SERVICE_CLIPBOARD,
    5154        SERVICE_NETWORKING,
  • uspace/srv/hid/kbd/generic/kbd.c

    r47f7adfc rb946bf83  
    6767static unsigned lock_keys;
    6868
    69 bool irc_service = false;
    70 int irc_phone = -1;
     69int cir_service = 0;
     70int cir_phone = -1;
    7171
    7272#define NUM_LAYOUTS 3
     
    216216        sysarg_t obio;
    217217       
    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);
    225226        }
    226227       
  • uspace/srv/hid/kbd/include/kbd.h

    r47f7adfc rb946bf83  
    3838#define KBD_KBD_H_
    3939
    40 #include <bool.h>
    41 
    42 extern bool irc_service;
    43 extern int irc_phone;
     40extern int cir_service;
     41extern int cir_phone;
    4442
    4543extern void kbd_push_scancode(int);
  • uspace/srv/hid/kbd/port/ns16550.c

    r47f7adfc rb946bf83  
    120120        kbd_push_scancode(scan_code);
    121121       
    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,
    124124                    IPC_GET_IMETHOD(*call));
    125125}
  • uspace/srv/hid/kbd/port/z8530.c

    r47f7adfc rb946bf83  
    108108        kbd_push_scancode(scan_code);
    109109       
    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,
    112112                    IPC_GET_IMETHOD(*call));
    113113}
  • uspace/srv/hw/irc/apic/apic.c

    r47f7adfc rb946bf83  
    107107       
    108108        async_set_client_connection(apic_connection);
    109         service_register(SERVICE_IRC);
     109        service_register(SERVICE_APIC);
    110110       
    111111        return true;
  • uspace/srv/hw/irc/fhc/fhc.c

    r47f7adfc rb946bf83  
    136136       
    137137        async_set_client_connection(fhc_connection);
    138         service_register(SERVICE_IRC);
     138        service_register(SERVICE_FHC);
    139139       
    140140        return true;
  • uspace/srv/hw/irc/i8259/i8259.c

    r47f7adfc rb946bf83  
    149149       
    150150        async_set_client_connection(i8259_connection);
    151         service_register(SERVICE_IRC);
     151        service_register(SERVICE_I8259);
    152152       
    153153        return true;
  • uspace/srv/hw/irc/obio/obio.c

    r47f7adfc rb946bf83  
    137137       
    138138        async_set_client_connection(obio_connection);
    139         service_register(SERVICE_IRC);
     139        service_register(SERVICE_OBIO);
    140140       
    141141        return true;
  • uspace/srv/hw/netif/ne2000/ne2000.c

    r47f7adfc rb946bf83  
    7575#define IRQ_GET_TSR(call)  ((int) IPC_GET_ARG3(call))
    7676
    77 static bool irc_service = false;
     77static int irc_service = 0;
    7878static int irc_phone = -1;
    7979
     
    383383        sysarg_t i8259;
    384384       
    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;
    388389       
    389390        if (irc_service) {
    390391                while (irc_phone < 0)
    391                         irc_phone = service_connect_blocking(SERVICE_IRC, 0, 0);
     392                        irc_phone = service_connect_blocking(irc_service, 0, 0);
    392393        }
    393394       
  • uspace/srv/net/net/net.c

    r47f7adfc rb946bf83  
    289289        if (rc != EOK)
    290290                return rc;
    291        
    292291        rc = add_module(NULL, &net_globals.modules, (uint8_t *) NE2000_NAME,
    293292            (uint8_t *) NE2000_FILENAME, SERVICE_NE2000, 0, connect_to_service);
    294293        if (rc != EOK)
    295294                return rc;
    296        
    297295        rc = add_module(NULL, &net_globals.modules, (uint8_t *) ETHERNET_NAME,
    298296            (uint8_t *) ETHERNET_FILENAME, SERVICE_ETHERNET, 0, connect_to_service);
    299297        if (rc != EOK)
    300298                return rc;
    301        
    302299        rc = add_module(NULL, &net_globals.modules, (uint8_t *) NILDUMMY_NAME,
    303300            (uint8_t *) NILDUMMY_FILENAME, SERVICE_NILDUMMY, 0, connect_to_service);
     
    593590                rc = start_device(netif);
    594591                if (rc != EOK) {
    595                         printf("%s: Ignoring failed interface %s (%s)\n", NAME,
     592                        printf("%s: Error starting interface %s (%s)\n", NAME,
    596593                            netif->name, str_error(rc));
    597594                        measured_strings_destroy(&netif->configuration);
    598595                        netifs_exclude_index(&net_globals.netifs, index);
    599                         continue;
     596                       
     597                        return rc;
    600598                }
    601599               
Note: See TracChangeset for help on using the changeset viewer.