12 Jan, 2018

1 commit


30 Jan, 2015

1 commit

  • this is an atempt to make the export of functions typesafe.
    I replaced the jumptable void ** by a struct (jt_funcs) with function pointers.
    The EXPORT_FUNC macro now has 3 fixed parameters and one
    variadic parameter
    The first is the name of the exported function,
    the rest of the parameters are used to format a functionpointer
    in the jumptable,

    the EXPORT_FUNC macros are expanded three times,
    1. to declare the members of the struct
    2. to initialize the structmember pointers
    3. to call the functions in stubs.c

    Signed-off-by: Martin Dorwig
    Acked-by: Simon Glass

    Signed-off-by: Simon Glass
    (resending to the list since my tweaks are not quite trivial)

    Martin Dorwig
     

28 Oct, 2014

1 commit


22 Oct, 2011

1 commit


05 Jul, 2010

1 commit

  • The hush shell dynamically allocates (and re-allocates) memory for the
    argument strings in the "char *argv[]" argument vector passed to
    commands. Any code that modifies these pointers will cause serious
    corruption of the malloc data structures and crash U-Boot, so make
    sure the compiler can check that no such modifications are being done
    by changing the code into "char * const argv[]".

    This modification is the result of debugging a strange crash caused
    after adding a new command, which used the following argument
    processing code which has been working perfectly fine in all Unix
    systems since version 6 - but not so in U-Boot:

    int main (int argc, char **argv)
    {
    while (--argc > 0 && **++argv == '-') {
    /* ====> */ while (*++*argv) {
    switch (**argv) {
    case 'd':
    debug++;
    break;
    ...
    default:
    usage ();
    }
    }
    }
    ...
    }

    The line marked "====>" will corrupt the malloc data structures and
    usually cause U-Boot to crash when the next command gets executed by
    the shell. With the modification, the compiler will prevent this with
    an
    error: increment of read-only location '*argv'

    N.B.: The code above can be trivially rewritten like this:

    while (--argc > 0 && **++argv == '-') {
    char *arg = *argv;
    while (*++arg) {
    switch (*arg) {
    ...

    Signed-off-by: Wolfgang Denk
    Acked-by: Mike Frysinger

    Wolfgang Denk
     

28 May, 2010

1 commit

  • The "-ffixed-r15" option doesn't work well for gcc4. Since we
    don't use gp for small data with option "-G0", we can use gp
    as global data pointer. This allows compiler to use r15. It
    is necessary for gcc4 to work properly.

    Signed-off-by: Thomas Chou
    Signed-off-by: Scott McNutt

    Thomas Chou
     

02 Sep, 2009

1 commit

  • Since the Blackfin ABI favors higher scratch registers by default, use the
    last scratch register (P3) for global data rather than the first (P5).
    This allows the compiler's register allocator to use higher number scratch
    P registers, which in turn better matches the Blackfin instruction set,
    which reduces the size of U-Boot by more than 1024 bytes...

    Signed-off-by: Robin Getz
    Signed-off-by: Mike Frysinger

    Robin Getz
     

15 Feb, 2008

2 commits


05 Feb, 2008

1 commit


26 Jul, 2003

1 commit


25 Jul, 2003

1 commit