Changeset e43cdac in mainline for uspace/app/top/screen.c


Ignore:
Timestamp:
2010-04-13T12:57:05Z (15 years ago)
Author:
Stanislav Kozina <stanislav.kozina@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a307beb
Parents:
638927a
Message:

Removed all floating point computation from top utility.
Now all percentages are computed using fixed point.
FPU was emmiting exception 16 when storing float from FP register into the
memory and I really cannot figure out why:-(

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/top/screen.c

    r638927a re43cdac  
    5252#define BLACK 0x000000
    5353
    54 static void print_float(float f, int precision)
    55 {
    56         printf("%2u.", (unsigned int) f);
     54static void print_float(ps_float f, int precision)
     55{
     56        printf("%2u.", f.upper / f.lower);
    5757        int i;
    58         float rest = (f - (int)f) * 10;
     58        unsigned int rest = (f.upper % f.lower) * 10;
    5959        for (i = 0; i < precision; ++i) {
    60                 printf("%d", (unsigned int)rest);
    61                 rest = (rest - (int)rest) * 10;
     60                printf("%d", rest / f.lower);
     61                rest = (rest % f.lower) * 10;
    6262        }
    6363}
     
    208208        fflush(stdout);
    209209        console_set_rgb_color(fphone(stdout), WHITE, BLACK);
    210         printf("      ID  Threads      Mem      %%Mem %%uCycles %%kCycles Name");
     210        printf("      ID  Threads      Mem      %%Mem %%uCycles %%kCycles  Name");
    211211        int i;
    212         for (i = 60; i < colls; ++i)
     212        for (i = 61; i < colls; ++i)
    213213                puts(" ");
    214214        fflush(stdout);
Note: See TracChangeset for help on using the changeset viewer.