Subversion Repositories Kolibri OS

Rev

Rev 6088 | Rev 6131 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6088 Rev 6103
Line 275... Line 275...
275
int do_command_line(const char* usercmd)
275
int do_command_line(const char* usercmd)
276
{
276
{
277
    char *cmdline;
277
    char *cmdline;
278
    int argc, i, c;
278
    int argc, i, c;
279
    char **argv;
279
    char **argv;
-
 
280
    int retval = 0;
Line 280... Line 281...
280
 
281
 
281
    if( (usercmd == NULL) || (*usercmd == 0) )
282
    if( (usercmd == NULL) || (*usercmd == 0) )
Line 282... Line 283...
282
        return 1;
283
        return 1;
Line 293... Line 294...
293
 
294
 
294
    while(1)
295
    while(1)
295
    {
296
    {
296
        static struct option long_options[] =
297
        static struct option long_options[] =
-
 
298
        {
-
 
299
            {"list-connectors",      no_argument,       0, OPTION_CONNECTORS},
297
        {
300
            {"list-connector-modes", required_argument, 0, OPTION_CONN_MODES},
298
            {"video", required_argument, 0, 'v'},
301
            {"video",                required_argument, 0, 'v'},
299
            {0, 0, 0, 0}
302
            {0, 0, 0, 0}
Line 300... Line 303...
300
        };
303
        };
Line 309... Line 312...
309
 
312
 
310
        switch(c)
313
        switch(c)
311
        {
314
        {
312
            case 'v':
315
            case 'v':
313
                printf("cmdline_mode %s\n",optarg);
316
                printf("cmdline_mode %s\n",optarg);
-
 
317
                retval = set_cmdline_mode_ext(main_device, optarg);
-
 
318
                break;
-
 
319
 
-
 
320
            case OPTION_CONNECTORS:
-
 
321
                list_connectors(main_device);
-
 
322
                break;
-
 
323
 
-
 
324
            case OPTION_CONN_MODES:
314
                set_cmdline_mode_ext(main_device, optarg);
325
                retval = list_connector_modes(main_device, optarg);
315
                break;
326
                break;
316
        }
327
        }
317
    }
328
    }
318
    __builtin_free(argv);
329
    __builtin_free(argv);
Line 319... Line 330...
319
    __builtin_free(cmdline);
330
    __builtin_free(cmdline);
320
 
331
 
Line 321... Line 332...
321
    return 0;
332
    return retval;
322
};
333
};
Line 854... Line 865...
854
    }
865
    }
Line 855... Line 866...
855
 
866
 
856
    return p;
867
    return p;
Line 857... Line -...
857
};
-
 
858
 
-
 
859
#include 
-
 
860
 
-
 
861
u64 long_div(u64 dividend, u64 divisor)
-
 
862
{
-
 
863
#if 1
-
 
864
    u32 high = divisor >> 32;
-
 
865
    u64 quot;
-
 
866
 
-
 
867
    if (high == 0) {
-
 
868
            quot = div_u64(dividend, divisor);
-
 
869
    } else {
-
 
870
            int n = 1 + fls(high);
-
 
871
            quot = div_u64(dividend >> n, divisor >> n);
-
 
872
 
-
 
873
            if (quot != 0)
-
 
874
                    quot--;
-
 
875
            if ((dividend - quot * divisor) >= divisor)
-
 
876
                    quot++;
-
 
877
    }
-
 
878
 
-
 
879
    return quot;
-
 
880
#endif
-
 
881
//    return dividend / divisor;
-
 
882
};
-
 
883
 
-
 
884
>
-