diff options
author | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2024-04-22 19:04:44 -0300 |
---|---|---|
committer | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2024-04-22 19:04:44 -0300 |
commit | 92787ae0c9bb15c7841d10654ef7a2e595664d99 (patch) | |
tree | 15450b2b4454094fc8571ae4932310a229e7519d /modules | |
parent | 522813da585389c158c6a84e688bc9f53daea38d (diff) |
New upstream version 2.0.14preupstream/2.0.14pre
Diffstat (limited to 'modules')
-rw-r--r-- | modules/benchmark.c | 7 | ||||
-rw-r--r-- | modules/computer/modules.c | 20 | ||||
-rw-r--r-- | modules/devices/riscv/processor.c | 2 | ||||
-rw-r--r-- | modules/devices/riscv/riscv_data.c | 9 |
4 files changed, 26 insertions, 12 deletions
diff --git a/modules/benchmark.c b/modules/benchmark.c index 18156e01..511c984e 100644 --- a/modules/benchmark.c +++ b/modules/benchmark.c @@ -253,7 +253,7 @@ bench_value benchmark_parallel_for(gint n_threads, { gchar *temp; int cpu_procs, cpu_cores, cpu_threads, cpu_nodes; - guint iter_per_thread, iter, thread_number = 0; + guint iter_per_thread=1, iter, thread_number = 0; GSList *threads = NULL, *t; GTimer *timer; @@ -603,7 +603,6 @@ do_benchmark_handler(GIOChannel *source, GIOCondition condition, gpointer data) GIOStatus status; gchar *result; bench_value r = EMPTY_BENCH_VALUE; - status = g_io_channel_read_line(source, &result, NULL, NULL, NULL); if (status != G_IO_STATUS_NORMAL) { DEBUG("error while reading benchmark result"); @@ -633,9 +632,7 @@ static void do_benchmark(void (*benchmark_function)(void), int entry) return; if (params.gui_running) { - gchar *argv[] = {params.argv0, "-b", entries[entry].name, - "-m", "benchmark.so", "-a", - NULL}; + gchar *argv[] = {params.argv0, "-b",entries[entry].name,NULL}; GPid bench_pid; gint bench_stdout; GtkWidget *bench_dialog; diff --git a/modules/computer/modules.c b/modules/computer/modules.c index 4c0c54ea..cec2d42e 100644 --- a/modules/computer/modules.c +++ b/modules/computer/modules.c @@ -238,11 +238,14 @@ static const gchar* get_module_icon(const char *modname, const char *path) return NULL; } +gint compar (gpointer a, gpointer b) {return strcmp( (char*)a, (char*)b );} + void scan_modules_do(void) { FILE *lsmod; gchar buffer[1024]; gchar *lsmod_path; gchar *module_icons; + GList *list=NULL,*a; const gchar *icon; if (!_module_hash_table) { _module_hash_table = g_hash_table_new(g_str_hash, g_str_equal); } @@ -264,7 +267,13 @@ void scan_modules_do(void) { (void)fgets(buffer, 1024, lsmod); /* Discards the first line */ + //Sort modules while (fgets(buffer, 1024, lsmod)) { + list=g_list_prepend(list,g_strdup(buffer)); + } + list=g_list_sort(list,(GCompareFunc)compar); + + while (list) { gchar *buf, *strmodule, *hashkey; gchar *author = NULL, *description = NULL, *license = NULL, *deps = NULL, *vermagic = NULL, *filename = NULL, *srcversion = NULL, *version = NULL, *retpoline = NULL, @@ -274,9 +283,7 @@ void scan_modules_do(void) { shell_status_pulse(); - buf = buffer; - - sscanf(buf, "%s %ld", modname, &memory); + sscanf(list->data, "%s %ld", modname, &memory); hashkey = g_strdup_printf("MOD%s", modname); buf = g_strdup_printf("/sbin/modinfo %s 2>/dev/null", modname); @@ -388,7 +395,14 @@ void scan_modules_do(void) { g_free(version); g_free(retpoline); g_free(intree); + + //next and free + a=list; + list=list->next; + free(a->data); + g_list_free_1(a); } + pclose(lsmod); g_free(lsmod_path); diff --git a/modules/devices/riscv/processor.c b/modules/devices/riscv/processor.c index d44ca542..cd8da4c7 100644 --- a/modules/devices/riscv/processor.c +++ b/modules/devices/riscv/processor.c @@ -104,7 +104,7 @@ processor_scan(void) processor = (Processor *) pi->data; /* strings can't be null or segfault later */ - STRIFNULL(processor->model_name, _("RISC-V Processor") ); + STRIFNULL(processor->model_name, "RISC-V Processor" ); UNKIFNULL(processor->mmu); UNKIFNULL(processor->isa); UNKIFNULL(processor->uarch); diff --git a/modules/devices/riscv/riscv_data.c b/modules/devices/riscv/riscv_data.c index 917e8e06..526067d3 100644 --- a/modules/devices/riscv/riscv_data.c +++ b/modules/devices/riscv/riscv_data.c @@ -47,6 +47,9 @@ static struct { { "Q", NC_("rv-ext", /*/ext:Q*/ "Floating-point instructions, quad-precision") }, { "B", NC_("rv-ext", /*/ext:B*/ "Bit manipulation instructions") }, { "V", NC_("rv-ext", /*/ext:V*/ "Vector operations") }, + { "Zk", NC_("rv-ext", /*/ext:Zk*/ "Scalar Cryptography") }, + { "S", NC_("rv-ext", /*/ext:S*/ "Supervisor-level Instructions") }, + { "U", NC_("rv-ext", /*/ext:U*/ "User Mode") }, { "T", NC_("rv-ext", /*/ext:T*/ "Transactional memory") }, { "P", NC_("rv-ext", /*/ext:P*/ "Packed SIMD instructions") }, { "L", NC_("rv-ext", /*/ext:L*/ "Decimal floating-point instructions") }, @@ -139,10 +142,10 @@ static int riscv_isa_next(const char *isap, char *flag) { } switch(*p) { - case 'S': case 's': /* supervisor extension */ - case 'X': case 'x': /* custom extension */ + // case 'S': case 's': /* supervisor extension */ + // case 'X': case 'x': /* custom extension */ /* custom supervisor extension (SX..) handled by S */ - break; + // break; default: /* single character (standard) extension */ tag_len = 1; if (next_digit != p+1) ver_len = 0; |