Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 47a728e1 in mainline


Ignore:
Timestamp:
2012-08-01T21:59:40Z (9 years ago)
Author:
Sean Bartell <wingedtachikoma@…>
Branches:
lfn, master
Children:
cb4a66d2
Parents:
23db8aa (diff), 9bcdbc5 (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 mainline changes

Files:
30 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/mips32/Makefile.inc

    r23db8aa r47a728e1  
    2929BFD_ARCH = mips
    3030BITS = 32
    31 EXTRA_CFLAGS = -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mips3 -mabi=32
     31EXTRA_CFLAGS = -msoft-float -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mips3 -mabi=32
    3232
    3333RD_SRVS_NON_ESSENTIAL += \
     
    4848        BFD_OUTPUT = binary
    4949        ENDIANESS = LE
    50         EXTRA_GCC_CFLAGS = -mhard-float
    5150endif
    5251
  • boot/arch/mips64/Makefile.inc

    r23db8aa r47a728e1  
    2929BFD_ARCH = mips:4000
    3030BITS = 64
    31 EXTRA_CFLAGS = -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mips3 -mabi=64
     31EXTRA_CFLAGS = -msoft-float -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mips3 -mabi=64
    3232
    3333ifeq ($(MACHINE),msim)
     
    3535        BFD_OUTPUT = binary
    3636        ENDIANESS = LE
    37         EXTRA_GCC_CFLAGS = -mhard-float
    3837endif
    3938
  • boot/generic/src/str.c

    r23db8aa r47a728e1  
    354354 *
    355355 * Do a char-by-char comparison of two NULL-terminated strings.
    356  * The strings are considered equal iff they consist of the same
    357  * characters on the minimum of their lengths.
     356 * The strings are considered equal iff their length is equal
     357 * and both strings consist of the same sequence of characters.
     358 *
     359 * A string S1 is less than another string S2 if it has a character with
     360 * lower value at the first character position where the strings differ.
     361 * If the strings differ in length, the shorter one is treated as if
     362 * padded by characters with a value of zero.
    358363 *
    359364 * @param s1 First string to compare.
    360365 * @param s2 Second string to compare.
    361366 *
    362  * @return 0 if the strings are equal, -1 if first is smaller,
    363  *         1 if second smaller.
     367 * @return 0 if the strings are equal, -1 if the first is less than the second,
     368 *         1 if the second is less than the first.
    364369 *
    365370 */
  • contrib/bazaar/bzreml/__init__.py

    r23db8aa r47a728e1  
    108108                if (revision_ac_id == revision_old_id):
    109109                        break
     110               
    110111                yield revision_ac_id
    111112
     
    117118                branch.repository.lock_read()
    118119                try:
    119                         body = StringIO()
     120                        revision_prev_id = revision_old_id
    120121                       
    121                         for revision_ac_id in revision_sequence(branch, revision_old_id, revision_new_id):
     122                        for revision_ac_id in reversed(list(revision_sequence(branch, revision_old_id, revision_new_id))):
     123                                body = StringIO()
     124                               
    122125                                revision_ac = branch.repository.get_revision(revision_ac_id)
    123126                                revision_ac_no = branch.revision_id_to_revno(revision_ac_id)
     
    139142                                body.write("\n")
    140143                               
    141                                 commit_message = ""
     144                                commit_message = None
    142145                                body.write("Log:\n")
    143146                                if (not revision_ac.message):
     
    147150                                        for line in log.split("\n"):
    148151                                                body.write("%s\n" % line)
    149                                                 if (commit_message == ""):
     152                                                if (commit_message == None):
    150153                                                        commit_message = line
    151154                               
    152                                 if (commit_message == ""):
     155                                if (commit_message == None):
    153156                                        commit_message = "(empty)"
    154157                               
    155158                                body.write("\n")
     159                               
     160                                tree_prev = branch.repository.revision_tree(revision_prev_id)
     161                                tree_ac = branch.repository.revision_tree(revision_ac_id)
     162                               
     163                                delta = tree_ac.changes_from(tree_prev)
     164                               
     165                                if (len(delta.added) > 0):
     166                                        body.write("Added:\n")
     167                                        for item in delta.added:
     168                                                body.write("    %s\n" % item[0])
     169                               
     170                                if (len(delta.removed) > 0):
     171                                        body.write("Removed:\n")
     172                                        for item in delta.removed:
     173                                                body.write("    %s\n" % item[0])
     174                               
     175                                if (len(delta.renamed) > 0):
     176                                        body.write("Renamed:\n")
     177                                        for item in delta.renamed:
     178                                                body.write("    %s -> %s\n" % (item[0], item[1]))
     179                               
     180                                if (len(delta.kind_changed) > 0):
     181                                        body.write("Changed:\n")
     182                                        for item in delta.kind_changed:
     183                                                body.write("    %s\n" % item[0])
     184                               
     185                                if (len(delta.modified) > 0):
     186                                        body.write("Modified:\n")
     187                                        for item in delta.modified:
     188                                                body.write("    %s\n" % item[0])
     189                               
     190                                body.write("\n")
     191                               
     192                                tree_prev.lock_read()
     193                                try:
     194                                        tree_ac.lock_read()
     195                                        try:
     196                                                diff = DiffTree.from_trees_options(tree_prev, tree_ac, body, "utf8", None, "", "", None)
     197                                                diff.show_diff(None, None)
     198                                        finally:
     199                                                tree_ac.unlock()
     200                                finally:
     201                                        tree_prev.unlock()
     202                               
     203                                subject = "r%d - %s" % (revision_ac_no, commit_message)
     204                                send_smtp("localhost", config_sender(config), config_to(config), subject, body.getvalue())
     205                               
     206                                revision_prev_id = revision_ac_id
    156207                       
    157                         tree_old = branch.repository.revision_tree(revision_old_id)
    158                         tree_new = branch.repository.revision_tree(revision_new_id)
    159                        
    160                         revision_new_no = branch.revision_id_to_revno(revision_new_id)
    161                         delta = tree_new.changes_from(tree_old)
    162                        
    163                         if (len(delta.added) > 0):
    164                                 body.write("Added:\n")
    165                                 for item in delta.added:
    166                                         body.write("    %s\n" % item[0])
    167                        
    168                         if (len(delta.removed) > 0):
    169                                 body.write("Removed:\n")
    170                                 for item in delta.removed:
    171                                         body.write("    %s\n" % item[0])
    172                        
    173                         if (len(delta.renamed) > 0):
    174                                 body.write("Renamed:\n")
    175                                 for item in delta.renamed:
    176                                         body.write("    %s -> %s\n" % (item[0], item[1]))
    177                        
    178                         if (len(delta.kind_changed) > 0):
    179                                 body.write("Changed:\n")
    180                                 for item in delta.kind_changed:
    181                                         body.write("    %s\n" % item[0])
    182                        
    183                         if (len(delta.modified) > 0):
    184                                 body.write("Modified:\n")
    185                                 for item in delta.modified:
    186                                         body.write("    %s\n" % item[0])
    187                        
    188                         body.write("\n")
    189                        
    190                         tree_old.lock_read()
    191                         try:
    192                                 tree_new.lock_read()
    193                                 try:
    194                                         diff = DiffTree.from_trees_options(tree_old, tree_new, body, "utf8", None, "", "", None)
    195                                         diff.show_diff(None, None)
    196                                 finally:
    197                                         tree_new.unlock()
    198                         finally:
    199                                 tree_old.unlock()
    200                        
    201                         subject = "r%d - %s" % (revision_new_no, commit_message)
    202                        
    203                         send_smtp("localhost", config_sender(config), config_to(config), subject, body.getvalue())
    204208                finally:
    205209                        branch.repository.unlock()
  • contrib/bazaar/bzreml/setup.py

    r23db8aa r47a728e1  
    77        description = 'Commit email plugin for Bazaar',
    88        keywords = 'plugin bzr email',
    9         version = '1.2',
     9        version = '1.3',
    1010        url = 'http://www.decky.cz/',
    1111        license = 'BSD',
     
    1313        author_email = 'martin@decky.cz',
    1414        long_description = """Hooks into Bazaar and sends commit notification emails.""",
    15         package_dir = {'bzrlib.plugins.eml':'.'}, 
     15        package_dir = {'bzrlib.plugins.eml':'.'},
    1616        packages = ['bzrlib.plugins.eml']
    1717)
  • contrib/conf/mips32-gx.sh

    r23db8aa r47a728e1  
    88fi
    99
    10 gxemul $@ -E oldtestmips -C R4000 -X image.boot -d d0:"$DISK_IMG"
     10if [ "$1" == "-E" ] && [ -n "$2" ]; then
     11        MACHINE="$2"
     12        shift 2
     13else
     14        MACHINE="oldtestmips"
     15fi
     16
     17gxemul $@ -E "$MACHINE" -C R4000 -X image.boot -d d0:"$DISK_IMG"
  • defaults/mips32/Makefile.config

    r23db8aa r47a728e1  
    4747CONFIG_MOUNT_DATA = n
    4848
     49# Barebone build with essential binaries only
     50CONFIG_BAREBONE = y
  • kernel/arch/mips32/Makefile.inc

    r23db8aa r47a728e1  
    2929BFD_ARCH = mips
    3030BFD = binary
    31 GCC_CFLAGS += -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mips3 -mabi=32
     31GCC_CFLAGS += -msoft-float -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mips3 -mabi=32
    3232
    3333BITS = 32
     
    4848        BFD_NAME = elf32-tradlittlemips
    4949        ENDIANESS = LE
    50         GCC_CFLAGS += -mhard-float
    5150endif
    5251
  • kernel/arch/mips64/Makefile.inc

    r23db8aa r47a728e1  
    2929BFD_ARCH = mips:4000
    3030BFD = binary
    31 GCC_CFLAGS += -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mips3 -mabi=64
     31GCC_CFLAGS += -msoft-float -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mips3 -mabi=64
    3232AFLAGS = -64
    3333
     
    4040        BFD_NAME = elf64-tradlittlemips
    4141        ENDIANESS = LE
    42         GCC_CFLAGS += -mhard-float
    4342endif
    4443
  • kernel/generic/src/lib/str.c

    r23db8aa r47a728e1  
    456456 *
    457457 * Do a char-by-char comparison of two NULL-terminated strings.
    458  * The strings are considered equal iff they consist of the same
    459  * characters on the minimum of their lengths.
     458 * The strings are considered equal iff their length is equal
     459 * and both strings consist of the same sequence of characters.
     460 *
     461 * A string S1 is less than another string S2 if it has a character with
     462 * lower value at the first character position where the strings differ.
     463 * If the strings differ in length, the shorter one is treated as if
     464 * padded by characters with a value of zero.
    460465 *
    461466 * @param s1 First string to compare.
    462467 * @param s2 Second string to compare.
    463468 *
    464  * @return 0 if the strings are equal, -1 if first is smaller,
    465  *         1 if second smaller.
     469 * @return 0 if the strings are equal, -1 if the first is less than the second,
     470 *         1 if the second is less than the first.
    466471 *
    467472 */
     
    494499 *
    495500 * Do a char-by-char comparison of two NULL-terminated strings.
    496  * The strings are considered equal iff they consist of the same
    497  * characters on the minimum of their lengths and the length limit.
     501 * The strings are considered equal iff
     502 * min(str_length(s1), max_len) == min(str_length(s2), max_len)
     503 * and both strings consist of the same sequence of characters,
     504 * up to max_len characters.
     505 *
     506 * A string S1 is less than another string S2 if it has a character with
     507 * lower value at the first character position where the strings differ.
     508 * If the strings differ in length, the shorter one is treated as if
     509 * padded by characters with a value of zero. Only the first max_len
     510 * characters are considered.
    498511 *
    499512 * @param s1      First string to compare.
     
    501514 * @param max_len Maximum number of characters to consider.
    502515 *
    503  * @return 0 if the strings are equal, -1 if first is smaller,
    504  *         1 if second smaller.
     516 * @return 0 if the strings are equal, -1 if the first is less than the second,
     517 *         1 if the second is less than the first.
    505518 *
    506519 */
  • uspace/app/sportdmp/sportdmp.c

    r23db8aa r47a728e1  
    3737static void syntax_print(void)
    3838{
    39         fprintf(stderr, "Usage: sportdmp <baud> <device_service>\n");
     39        fprintf(stderr, "Usage: sportdmp [--baud=<baud>] [device_service]\n");
    4040}
    4141
    4242int main(int argc, char **argv)
    4343{
    44         const char* svc_path = "devices/\\hw\\pci0\\00:01.0\\com1\\a";
    4544        sysarg_t baud = 9600;
     45        service_id_t svc_id;
    4646       
    47         if (argc > 1) {
     47        int arg = 1;
     48        int rc;
     49               
     50        if (argc > arg && str_test_prefix(argv[arg], "--baud=")) {
     51                size_t arg_offset = str_lsize(argv[arg], 7);
     52                char* arg_str = argv[arg] + arg_offset;
     53                if (str_length(arg_str) == 0) {
     54                        fprintf(stderr, "--baud requires an argument\n");
     55                        syntax_print();
     56                        return 1;
     57                }
    4858                char *endptr;
    49                 baud = strtol(argv[1], &endptr, 10);
     59                baud = strtol(arg_str, &endptr, 10);
    5060                if (*endptr != '\0') {
    5161                        fprintf(stderr, "Invalid value for baud\n");
     
    5363                        return 1;
    5464                }
     65                arg++;
    5566        }
    5667       
    57         if (argc > 2) {
    58                 svc_path = argv[2];
     68        if (argc > arg) {
     69                rc = loc_service_get_id(argv[arg], &svc_id, 0);
     70                if (rc != EOK) {
     71                        fprintf(stderr, "Cannot find device service %s\n",
     72                            argv[arg]);
     73                        return 1;
     74                }
     75                arg++;
     76        }
     77        else {
     78                category_id_t serial_cat_id;
     79               
     80                rc = loc_category_get_id("serial", &serial_cat_id, 0);
     81                if (rc != EOK) {
     82                        fprintf(stderr, "Failed getting id of category "
     83                            "'serial'\n");
     84                        return 1;
     85                }
     86               
     87                service_id_t *svc_ids;
     88                size_t svc_count;
     89               
     90                rc = loc_category_get_svcs(serial_cat_id, &svc_ids, &svc_count);                if (rc != EOK) {
     91                        fprintf(stderr, "Failed getting list of services\n");
     92                        return 1;
     93                }
     94               
     95                if (svc_count == 0) {
     96                        fprintf(stderr, "No service in category 'serial'\n");
     97                        free(svc_ids);
     98                        return 1;
     99                }
     100               
     101                svc_id = svc_ids[0];
     102                free(svc_ids);
    59103        }
    60104       
    61         if (argc > 3) {
     105        if (argc > arg) {
     106                fprintf(stderr, "Too many arguments\n");
    62107                syntax_print();
    63108                return 1;
    64109        }
    65110       
    66         service_id_t svc_id;
    67         int rc = loc_service_get_id(svc_path, &svc_id, IPC_FLAG_BLOCKING);
    68         if (rc != EOK) {
    69                 fprintf(stderr, "Cannot find device service %s\n", svc_path);
    70                 return 1;
    71         }
    72111       
    73112        async_sess_t *sess = loc_service_connect(EXCHANGE_SERIALIZE, svc_id,
    74113            IPC_FLAG_BLOCKING);
    75114        if (!sess) {
    76                 fprintf(stderr, "Failed connecting to service %s\n", svc_path);
     115                fprintf(stderr, "Failed connecting to service\n");
    77116        }
    78117       
  • uspace/lib/c/arch/abs32le/_link.ld.in

    r23db8aa r47a728e1  
    1414SECTIONS {
    1515#ifdef LOADER
     16        . = 0x70001000 + SIZEOF_HEADERS;
     17       
    1618        .interp : {
    1719                *(.interp);
    18         } :interp
    19        
    20         . = 0x70001000 + SIZEOF_HEADERS;
     20        } :interp :text
    2121#else
    2222        . = 0x1000 + SIZEOF_HEADERS;
    2323#endif
     24       
     25        /* Make sure the code is aligned reasonably */
     26        . = ALIGN(., 16);
     27       
    2428        .text : {
    2529                *(.text .text.*);
  • uspace/lib/c/arch/amd64/_link.ld.in

    r23db8aa r47a728e1  
    1515SECTIONS {
    1616#ifdef LOADER
     17        . = 0x70001000 + SIZEOF_HEADERS;
     18       
    1719        .interp : {
    1820                *(.interp);
    19         } :interp
    20        
    21         . = 0x70001000 + SIZEOF_HEADERS;
     21        } :interp :text
    2222#else
    2323        . = 0x1000 + SIZEOF_HEADERS;
    2424#endif
     25       
     26        /* Make sure the code is aligned reasonably */
     27        . = ALIGN(., 16);
     28       
    2529        .init : {
    2630                *(.init);
  • uspace/lib/c/arch/arm32/_link.ld.in

    r23db8aa r47a728e1  
    1414SECTIONS {
    1515#ifdef LOADER
     16        . = 0x70001000 + SIZEOF_HEADERS;
     17       
    1618        .interp : {
    1719                *(.interp);
    18         } :interp
    19        
    20         . = 0x70001000 + SIZEOF_HEADERS;
     20        } :interp :text
    2121#else
    2222        . = 0x1000 + SIZEOF_HEADERS;
    2323#endif
     24       
     25        /* Make sure the code is aligned reasonably */
     26        . = ALIGN(., 8);
     27       
    2428        .init : {
    2529                *(.init);
  • uspace/lib/c/arch/arm32/src/fibril.S

    r23db8aa r47a728e1  
    3535        stmia r0!, {sp, lr}
    3636        stmia r0!, {r4-r11}
    37 
     37       
    3838        # return 1
    3939        mov r0, #1
     
    4343        ldmia r0!, {sp, lr}
    4444        ldmia r0!, {r4-r11}
    45 
    46         #return 0
     45       
     46        # return 0
    4747        mov r0, #0
    4848        mov pc, lr
  • uspace/lib/c/arch/arm32/src/stacktrace_asm.S

    r23db8aa r47a728e1  
    4141
    4242stacktrace_pc_get:
    43         mov r0, lr 
     43        mov r0, lr
    4444        mov pc, lr
  • uspace/lib/c/arch/arm32/src/thread_entry.s

    r23db8aa r47a728e1  
    4242        push {fp, ip, lr, pc}
    4343        sub fp, ip, #4
    44 
    45         b __thread_main
     44       
     45        b __thread_main
  • uspace/lib/c/arch/ia32/_link.ld.in

    r23db8aa r47a728e1  
    1919
    2020SECTIONS {
    21 #if defined(LOADER) || defined(DLEXE)
    22         .interp : {
    23                 *(.interp);
    24         } :interp
    25 #endif
    2621#ifdef LOADER
    2722        . = 0x70001000 + SIZEOF_HEADERS;
     
    2924        . = 0x1000 + SIZEOF_HEADERS;
    3025#endif
     26       
     27#if defined(LOADER) || defined(DLEXE)
     28        .interp : {
     29                *(.interp);
     30        } :interp :text
     31#endif
     32       
     33        /* Make sure the code is aligned reasonably */
     34        . = ALIGN(., 16);
     35       
    3136        .init : {
    3237                *(.init);
     
    3742                *(.rodata .rodata.*);
    3843        } :text
    39 
     44       
    4045#if defined(SHLIB) || defined(DLEXE)
    4146        .rel.plt : {
     
    8085#if defined(SHLIB) || defined(DLEXE)
    8186        .data.rel : {
    82                 *(.data.rel .data.rel.*);
     87                *(.data.rel .data.rel.*);
    8388        } :data
    84 
     89       
    8590        .got : {
    86                 *(.got);
     91                *(.got);
    8792        } :data
     93       
    8894        .got.plt : {
    89                 *(.got.plt);
     95                *(.got.plt);
    9096        } :data
    9197#endif
  • uspace/lib/c/arch/ia64/_link.ld.in

    r23db8aa r47a728e1  
    1414SECTIONS {
    1515#ifdef LOADER
     16        . = 0x800000000 + SIZEOF_HEADERS;
     17       
    1618        .interp : {
    1719                *(.interp);
    18         } :interp
    19        
    20         . = 0x800000000 + SIZEOF_HEADERS;
     20        } :interp :text
    2121#else
    2222        . = 0x4000 + SIZEOF_HEADERS;
    2323#endif
    24         /*
    25          * XXX This is just a work around. Problem: .init section does not
    26          * have the proper alignment.
    27          */
     24       
     25        /* Make sure the code is aligned reasonably */
    2826        . = ALIGN(., 16);
    29 
     27       
    3028        .init : {
    3129                *(.init);
  • uspace/lib/c/arch/mips32/Makefile.common

    r23db8aa r47a728e1  
    2727#
    2828
    29 GCC_CFLAGS += -mips3 -mabi=32
     29GCC_CFLAGS += -msoft-float -mips3 -mabi=32
    3030
    3131ENDIANESS = LE
  • uspace/lib/c/arch/mips32/_link.ld.in

    r23db8aa r47a728e1  
    1414SECTIONS {
    1515#ifdef LOADER
     16        . = 0x70004000 + SIZEOF_HEADERS;
     17       
    1618        .interp : {
    1719                *(.interp);
    18         } :interp
    19        
    20         . = 0x70004000 + SIZEOF_HEADERS;
     20        } :interp :text
    2121#else
    2222        . = 0x4000 + SIZEOF_HEADERS;
    2323#endif
     24       
     25        /* Make sure the code is aligned reasonably */
     26        . = ALIGN(., 16);
     27       
    2428        .init : {
    2529                *(.init);
  • uspace/lib/c/arch/mips32eb/Makefile.common

    r23db8aa r47a728e1  
    2727#
    2828
    29 GCC_CFLAGS += -mips3 -mabi=32
     29GCC_CFLAGS += -msoft-float -mips3 -mabi=32
    3030
    3131ENDIANESS = BE
  • uspace/lib/c/arch/mips64/Makefile.common

    r23db8aa r47a728e1  
    2727#
    2828
    29 GCC_CFLAGS += -mips3 -mabi=64
     29GCC_CFLAGS += -msoft-float -mips3 -mabi=64
    3030AFLAGS = -64
    3131
  • uspace/lib/c/arch/mips64/_link.ld.in

    r23db8aa r47a728e1  
    1515SECTIONS {
    1616#ifdef LOADER
     17        . = 0x70004000 + SIZEOF_HEADERS;
     18       
    1719        .interp : {
    1820                *(.interp);
    19         } :interp
    20        
    21         . = 0x70004000 + SIZEOF_HEADERS;
     21        } :interp :text
    2222#else
    2323        . = 0x4000 + SIZEOF_HEADERS;
    2424#endif
     25       
     26        /* Make sure the code is aligned reasonably */
     27        . = ALIGN(., 16);
     28       
    2529        .init : {
    2630                *(.init);
  • uspace/lib/c/arch/ppc32/_link.ld.in

    r23db8aa r47a728e1  
    1515SECTIONS {
    1616#ifdef LOADER
     17        . = 0x70001000 + SIZEOF_HEADERS;
     18       
    1719        .interp : {
    1820                *(.interp);
    19         } :interp
    20        
    21         . = 0x70001000 + SIZEOF_HEADERS;
     21        } :interp :text
    2222#else
    2323        . = 0x1000 + SIZEOF_HEADERS;
    2424#endif
     25       
     26        /* Make sure the code is aligned reasonably */
     27        . = ALIGN(., 4);
     28       
    2529        .init : {
    2630                *(.init);
  • uspace/lib/c/arch/sparc64/_link.ld.in

    r23db8aa r47a728e1  
    1414SECTIONS {
    1515#ifdef LOADER
     16        . = 0x70004000 + SIZEOF_HEADERS;
     17       
    1618        .interp : {
    1719                *(.interp);
    18         } :interp
    19        
    20         . = 0x70004000 + SIZEOF_HEADERS;
     20        } :interp :text
    2121#else
    2222        . = 0x4000 + SIZEOF_HEADERS;
    2323#endif
     24       
     25        /* Make sure the code is aligned reasonably */
     26        . = ALIGN(., 16);
     27       
    2428        .init : {
    2529                *(.init);
  • uspace/lib/c/generic/str.c

    r23db8aa r47a728e1  
    428428 *
    429429 * Do a char-by-char comparison of two NULL-terminated strings.
    430  * The strings are considered equal iff they consist of the same
    431  * characters on the minimum of their lengths.
     430 * The strings are considered equal iff their length is equal
     431 * and both strings consist of the same sequence of characters.
     432 *
     433 * A string S1 is less than another string S2 if it has a character with
     434 * lower value at the first character position where the strings differ.
     435 * If the strings differ in length, the shorter one is treated as if
     436 * padded by characters with a value of zero.
    432437 *
    433438 * @param s1 First string to compare.
    434439 * @param s2 Second string to compare.
    435440 *
    436  * @return 0 if the strings are equal, -1 if first is smaller,
    437  *         1 if second smaller.
     441 * @return 0 if the strings are equal, -1 if the first is less than the second,
     442 *         1 if the second is less than the first.
    438443 *
    439444 */
     
    466471 *
    467472 * Do a char-by-char comparison of two NULL-terminated strings.
    468  * The strings are considered equal iff they consist of the same
    469  * characters on the minimum of their lengths and the length limit.
     473 * The strings are considered equal iff
     474 * min(str_length(s1), max_len) == min(str_length(s2), max_len)
     475 * and both strings consist of the same sequence of characters,
     476 * up to max_len characters.
     477 *
     478 * A string S1 is less than another string S2 if it has a character with
     479 * lower value at the first character position where the strings differ.
     480 * If the strings differ in length, the shorter one is treated as if
     481 * padded by characters with a value of zero. Only the first max_len
     482 * characters are considered.
    470483 *
    471484 * @param s1      First string to compare.
     
    473486 * @param max_len Maximum number of characters to consider.
    474487 *
    475  * @return 0 if the strings are equal, -1 if first is smaller,
    476  *         1 if second smaller.
     488 * @return 0 if the strings are equal, -1 if the first is less than the second,
     489 *         1 if the second is less than the first.
    477490 *
    478491 */
     
    508521        return 0;
    509522
     523}
     524
     525/** Test whether p is a prefix of s.
     526 *
     527 * Do a char-by-char comparison of two NULL-terminated strings
     528 * and determine if p is a prefix of s.
     529 *
     530 * @param s The string in which to look
     531 * @param p The string to check if it is a prefix of s
     532 *
     533 * @return true iff p is prefix of s else false
     534 *
     535 */
     536bool str_test_prefix(const char *s, const char *p)
     537{
     538        wchar_t c1 = 0;
     539        wchar_t c2 = 0;
     540       
     541        size_t off1 = 0;
     542        size_t off2 = 0;
     543
     544        while (true) {
     545                c1 = str_decode(s, &off1, STR_NO_LIMIT);
     546                c2 = str_decode(p, &off2, STR_NO_LIMIT);
     547               
     548                if (c2 == 0)
     549                        return true;
     550
     551                if (c1 != c2)
     552                        return false;
     553               
     554                if (c1 == 0)
     555                        break;
     556        }
     557
     558        return false;
    510559}
    511560
     
    10851134                c = (c >= 'a' ? c - 'a' + 10 : (c >= 'A' ? c - 'A' + 10 :
    10861135                    (c <= '9' ? c - '0' : 0xff)));
    1087                 if (c > base) {
     1136                if (c >= base) {
    10881137                        break;
    10891138                }
  • uspace/lib/c/include/str.h

    r23db8aa r47a728e1  
    7979extern int str_lcmp(const char *s1, const char *s2, size_t max_len);
    8080
     81extern bool str_test_prefix(const char *s, const char *p);
     82
    8183extern void str_cpy(char *dest, size_t size, const char *src);
    8284extern void str_ncpy(char *dest, size_t size, const char *src, size_t n);
  • uspace/lib/clui/tinput.c

    r23db8aa r47a728e1  
    601601       
    602602        unsigned int cols = max(1, (ti->con_cols + 1) / (max_length + 1));
    603         unsigned int col_width = ti->con_cols / cols;
     603        unsigned int padding = 0;
     604        if ((cols * max_length) + (cols - 1) < ti->con_cols) {
     605                padding = ti->con_cols - (cols * max_length) - (cols - 1);
     606        }
     607        unsigned int col_width = max_length + padding / cols;
    604608        unsigned int rows = cnum / cols + ((cnum % cols) != 0);
    605609       
  • uspace/srv/loader/interp.S

    r23db8aa r47a728e1  
    55#
    66
    7 #ifdef UARCH_arm32
    8 #define AT_NOTE %note
    9 #else
    10 #define AT_NOTE @note
     7#if ((defined(UARCH_abs32le)) && (defined(COMPILER_gcc_cross)) \
     8    && (defined(CROSS_TARGET_arm32)))
     9        #define ATSIGN(arg)  % ## arg
    1110#endif
    1211
    13 .section .interp, "a", AT_NOTE
     12#ifdef UARCH_arm32
     13        #define ATSIGN(arg)  % ## arg
     14#endif
     15
     16#ifndef ATSIGN
     17        #define ATSIGN(arg)  @ ## arg
     18#endif
     19
     20.section .interp, "a", ATSIGN(progbits)
    1421        .string "kernel"
Note: See TracChangeset for help on using the changeset viewer.