Two coreinfo patches one of which is needed to update coreinfo for changes in libpayload.
Changes to libpayload to fix subwindows "broke" coreinfo. This fixes it, and improves performance by eliminating the entire screen refresh every second.
Signed-off-by: Jordan Crouse jordan.crouse@amd.com Index: coreinfo/coreinfo.c =================================================================== --- coreinfo.orig/coreinfo.c 2008-05-13 14:31:34.000000000 -0600 +++ coreinfo/coreinfo.c 2008-05-13 17:36:05.000000000 -0600 @@ -19,7 +19,7 @@
#include "coreinfo.h"
-#define SCREEN_Y 24 +#define SCREEN_Y 25 #define SCREEN_X 80
extern struct coreinfo_module cpuinfo_module; @@ -73,6 +73,8 @@
static WINDOW *modwin; +static WINDOW *menuwin; + static int curwin;
void print_module_title(WINDOW *win, const char *title) @@ -94,10 +96,10 @@ char menu[80]; char *ptr = menu;
- wmove(stdscr, SCREEN_Y - 2, 0); + wmove(menuwin, 0, 0);
for (j = 0; j < SCREEN_X; j++) - waddch(stdscr, ' '); + waddch(menuwin, ' ');
if (!cat->count) return; @@ -105,7 +107,7 @@ for (i = 0; i < cat->count; i++) ptr += sprintf(ptr, "[%c: %s] ", 'A' + i, cat->modules[i]->name);
- mvprintw(SCREEN_Y - 2, 0, menu); + mvwprintw(menuwin, 0, 0, menu); }
#ifdef CONFIG_SHOW_DATE_TIME @@ -118,7 +120,7 @@
rtc_read_clock(&tm);
- mvprintw(23, 57, "%02d/%02d/%04d - %02d:%02d:%02d", + mvwprintw(menuwin, 0, 57, "%02d/%02d/%04d - %02d:%02d:%02d", tm.tm_mon, tm.tm_mday, 1900+tm.tm_year, tm.tm_hour, tm.tm_min, tm.tm_sec); } @@ -130,10 +132,10 @@ char menu[80]; char *ptr = menu;
- wmove(stdscr, SCREEN_Y - 1, 0); + wmove(menuwin, 1, 0);
for (j = 0; j < SCREEN_X; j++) - waddch(stdscr, ' '); + waddch(menuwin, ' ');
for (i = 0; i < ARRAY_SIZE(categories); i++) { if (categories[i].count == 0) @@ -142,7 +144,7 @@ ptr += sprintf(ptr, "F%d: %s ", i + 1, categories[i].name); }
- mvprintw(23, 0, menu); + mvwprintw(menuwin, 1, 0, menu);
#ifdef CONFIG_SHOW_DATE_TIME print_time_and_date(); @@ -192,7 +194,7 @@
wclear(modwin); cat->modules[cat->cur]->redraw(modwin); - refresh(); + wrefresh(modwin); }
static void handle_category_key(struct coreinfo_cat *cat, int key) @@ -219,6 +221,7 @@ int key;
center(0, "coreinfo v0.1"); + refresh();
print_menu(); print_submenu(&categories[curwin]); @@ -229,7 +232,7 @@ while (1) { #ifdef CONFIG_SHOW_DATE_TIME print_time_and_date(); - refresh(); + wrefresh(menuwin); #endif
key = getch(); @@ -271,10 +274,12 @@ init_pair(2, COLOR_BLACK, COLOR_WHITE); init_pair(3, COLOR_WHITE, COLOR_WHITE);
- modwin = newwin(SCREEN_Y-2, SCREEN_X, 1, 0); + modwin = newwin(SCREEN_Y - 3, SCREEN_X, 1, 0); + menuwin = newwin(2, SCREEN_X, SCREEN_Y - 2, 0);
wattrset(stdscr, COLOR_PAIR(1) | A_BOLD); wattrset(modwin, COLOR_PAIR(2)); + wattrset(menuwin, COLOR_PAIR(1) | A_BOLD);
for (i = 0; i < SCREEN_Y - 1; i++) { wmove(modwin, i - 1, 0); @@ -283,7 +288,7 @@ waddch(modwin, ' '); }
- refresh(); + wrefresh(modwin);
for (i = 0; i < ARRAY_SIZE(categories); i++) { for(j = 0; j < categories[i].count; j++)
On Tue, May 13, 2008 at 05:38:47PM -0600, jordan.crouse@amd.com wrote:
Changes to libpayload to fix subwindows "broke" coreinfo. This fixes it, and improves performance by eliminating the entire screen refresh every second.
Signed-off-by: Jordan Crouse jordan.crouse@amd.com
Acked-by: Peter Stuge peter@stuge.se
Index: coreinfo/coreinfo.c
--- coreinfo.orig/coreinfo.c 2008-05-13 14:31:34.000000000 -0600 +++ coreinfo/coreinfo.c 2008-05-13 17:36:05.000000000 -0600 @@ -19,7 +19,7 @@
#include "coreinfo.h"
-#define SCREEN_Y 24 +#define SCREEN_Y 25 #define SCREEN_X 80
extern struct coreinfo_module cpuinfo_module; @@ -73,6 +73,8 @@
static WINDOW *modwin; +static WINDOW *menuwin;
static int curwin;
void print_module_title(WINDOW *win, const char *title) @@ -94,10 +96,10 @@ char menu[80]; char *ptr = menu;
- wmove(stdscr, SCREEN_Y - 2, 0);
wmove(menuwin, 0, 0);
for (j = 0; j < SCREEN_X; j++)
waddch(stdscr, ' ');
waddch(menuwin, ' ');
if (!cat->count) return;
@@ -105,7 +107,7 @@ for (i = 0; i < cat->count; i++) ptr += sprintf(ptr, "[%c: %s] ", 'A' + i, cat->modules[i]->name);
- mvprintw(SCREEN_Y - 2, 0, menu);
- mvwprintw(menuwin, 0, 0, menu);
}
#ifdef CONFIG_SHOW_DATE_TIME @@ -118,7 +120,7 @@
rtc_read_clock(&tm);
- mvprintw(23, 57, "%02d/%02d/%04d - %02d:%02d:%02d",
- mvwprintw(menuwin, 0, 57, "%02d/%02d/%04d - %02d:%02d:%02d", tm.tm_mon, tm.tm_mday, 1900+tm.tm_year, tm.tm_hour, tm.tm_min, tm.tm_sec);
} @@ -130,10 +132,10 @@ char menu[80]; char *ptr = menu;
- wmove(stdscr, SCREEN_Y - 1, 0);
wmove(menuwin, 1, 0);
for (j = 0; j < SCREEN_X; j++)
waddch(stdscr, ' ');
waddch(menuwin, ' ');
for (i = 0; i < ARRAY_SIZE(categories); i++) { if (categories[i].count == 0)
@@ -142,7 +144,7 @@ ptr += sprintf(ptr, "F%d: %s ", i + 1, categories[i].name); }
- mvprintw(23, 0, menu);
- mvwprintw(menuwin, 1, 0, menu);
#ifdef CONFIG_SHOW_DATE_TIME print_time_and_date(); @@ -192,7 +194,7 @@
wclear(modwin); cat->modules[cat->cur]->redraw(modwin);
- refresh();
- wrefresh(modwin);
}
static void handle_category_key(struct coreinfo_cat *cat, int key) @@ -219,6 +221,7 @@ int key;
center(0, "coreinfo v0.1");
refresh();
print_menu(); print_submenu(&categories[curwin]);
@@ -229,7 +232,7 @@ while (1) { #ifdef CONFIG_SHOW_DATE_TIME print_time_and_date();
refresh();
wrefresh(menuwin);
#endif
key = getch();
@@ -271,10 +274,12 @@ init_pair(2, COLOR_BLACK, COLOR_WHITE); init_pair(3, COLOR_WHITE, COLOR_WHITE);
- modwin = newwin(SCREEN_Y-2, SCREEN_X, 1, 0);
modwin = newwin(SCREEN_Y - 3, SCREEN_X, 1, 0);
menuwin = newwin(2, SCREEN_X, SCREEN_Y - 2, 0);
wattrset(stdscr, COLOR_PAIR(1) | A_BOLD); wattrset(modwin, COLOR_PAIR(2));
wattrset(menuwin, COLOR_PAIR(1) | A_BOLD);
for (i = 0; i < SCREEN_Y - 1; i++) { wmove(modwin, i - 1, 0);
@@ -283,7 +288,7 @@ waddch(modwin, ' '); }
- refresh();
wrefresh(modwin);
for (i = 0; i < ARRAY_SIZE(categories); i++) { for(j = 0; j < categories[i].count; j++)
Changes to libpayload to fix subwindows "broke" coreinfo. This fixes it, and improves performance by eliminating the entire screen refresh every second.
Signed-off-by: Jordan Crouse jordan.crouse@amd.com
Acked-by: Myles Watson mylesgw@gmail.com
Index: coreinfo/coreinfo.c
--- coreinfo.orig/coreinfo.c 2008-05-13 14:31:34.000000000 -0600 +++ coreinfo/coreinfo.c 2008-05-13 17:36:05.000000000 -0600 @@ -19,7 +19,7 @@
#include "coreinfo.h"
-#define SCREEN_Y 24 +#define SCREEN_Y 25 #define SCREEN_X 80
extern struct coreinfo_module cpuinfo_module; @@ -73,6 +73,8 @@
static WINDOW *modwin; +static WINDOW *menuwin;
static int curwin;
void print_module_title(WINDOW *win, const char *title) @@ -94,10 +96,10 @@ char menu[80]; char *ptr = menu;
- wmove(stdscr, SCREEN_Y - 2, 0);
wmove(menuwin, 0, 0);
for (j = 0; j < SCREEN_X; j++)
waddch(stdscr, ' ');
waddch(menuwin, ' ');
if (!cat->count) return;
@@ -105,7 +107,7 @@ for (i = 0; i < cat->count; i++) ptr += sprintf(ptr, "[%c: %s] ", 'A' + i, cat->modules[i]-
name);
- mvprintw(SCREEN_Y - 2, 0, menu);
- mvwprintw(menuwin, 0, 0, menu);
}
#ifdef CONFIG_SHOW_DATE_TIME @@ -118,7 +120,7 @@
rtc_read_clock(&tm);
- mvprintw(23, 57, "%02d/%02d/%04d - %02d:%02d:%02d",
- mvwprintw(menuwin, 0, 57, "%02d/%02d/%04d - %02d:%02d:%02d", tm.tm_mon, tm.tm_mday, 1900+tm.tm_year, tm.tm_hour, tm.tm_min, tm.tm_sec);
} @@ -130,10 +132,10 @@ char menu[80]; char *ptr = menu;
- wmove(stdscr, SCREEN_Y - 1, 0);
wmove(menuwin, 1, 0);
for (j = 0; j < SCREEN_X; j++)
waddch(stdscr, ' ');
waddch(menuwin, ' ');
for (i = 0; i < ARRAY_SIZE(categories); i++) { if (categories[i].count == 0)
@@ -142,7 +144,7 @@ ptr += sprintf(ptr, "F%d: %s ", i + 1, categories[i].name); }
- mvprintw(23, 0, menu);
- mvwprintw(menuwin, 1, 0, menu);
#ifdef CONFIG_SHOW_DATE_TIME print_time_and_date(); @@ -192,7 +194,7 @@
wclear(modwin); cat->modules[cat->cur]->redraw(modwin);
- refresh();
- wrefresh(modwin);
}
static void handle_category_key(struct coreinfo_cat *cat, int key) @@ -219,6 +221,7 @@ int key;
center(0, "coreinfo v0.1");
refresh();
print_menu(); print_submenu(&categories[curwin]);
@@ -229,7 +232,7 @@ while (1) { #ifdef CONFIG_SHOW_DATE_TIME print_time_and_date();
refresh();
wrefresh(menuwin);
#endif
key = getch();
@@ -271,10 +274,12 @@ init_pair(2, COLOR_BLACK, COLOR_WHITE); init_pair(3, COLOR_WHITE, COLOR_WHITE);
- modwin = newwin(SCREEN_Y-2, SCREEN_X, 1, 0);
modwin = newwin(SCREEN_Y - 3, SCREEN_X, 1, 0);
menuwin = newwin(2, SCREEN_X, SCREEN_Y - 2, 0);
wattrset(stdscr, COLOR_PAIR(1) | A_BOLD); wattrset(modwin, COLOR_PAIR(2));
wattrset(menuwin, COLOR_PAIR(1) | A_BOLD);
for (i = 0; i < SCREEN_Y - 1; i++) { wmove(modwin, i - 1, 0);
@@ -283,7 +288,7 @@ waddch(modwin, ' '); }
- refresh();
wrefresh(modwin);
for (i = 0; i < ARRAY_SIZE(categories); i++) { for(j = 0; j < categories[i].count; j++)
-- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc.
-- coreboot mailing list coreboot@coreboot.org http://www.coreboot.org/mailman/listinfo/coreboot
On 15/05/08 10:24 -0600, Myles Watson wrote:
Changes to libpayload to fix subwindows "broke" coreinfo. This fixes it, and improves performance by eliminating the entire screen refresh every second.
Signed-off-by: Jordan Crouse jordan.crouse@amd.com
Acked-by: Myles Watson mylesgw@gmail.com
Oops - answered the wrong email. This hasn't been comitted yet.
Index: coreinfo/coreinfo.c
--- coreinfo.orig/coreinfo.c 2008-05-13 14:31:34.000000000 -0600 +++ coreinfo/coreinfo.c 2008-05-13 17:36:05.000000000 -0600 @@ -19,7 +19,7 @@
#include "coreinfo.h"
-#define SCREEN_Y 24 +#define SCREEN_Y 25 #define SCREEN_X 80
extern struct coreinfo_module cpuinfo_module; @@ -73,6 +73,8 @@
static WINDOW *modwin; +static WINDOW *menuwin;
static int curwin;
void print_module_title(WINDOW *win, const char *title) @@ -94,10 +96,10 @@ char menu[80]; char *ptr = menu;
- wmove(stdscr, SCREEN_Y - 2, 0);
wmove(menuwin, 0, 0);
for (j = 0; j < SCREEN_X; j++)
waddch(stdscr, ' ');
waddch(menuwin, ' ');
if (!cat->count) return;
@@ -105,7 +107,7 @@ for (i = 0; i < cat->count; i++) ptr += sprintf(ptr, "[%c: %s] ", 'A' + i, cat->modules[i]-
name);
- mvprintw(SCREEN_Y - 2, 0, menu);
- mvwprintw(menuwin, 0, 0, menu);
}
#ifdef CONFIG_SHOW_DATE_TIME @@ -118,7 +120,7 @@
rtc_read_clock(&tm);
- mvprintw(23, 57, "%02d/%02d/%04d - %02d:%02d:%02d",
- mvwprintw(menuwin, 0, 57, "%02d/%02d/%04d - %02d:%02d:%02d", tm.tm_mon, tm.tm_mday, 1900+tm.tm_year, tm.tm_hour, tm.tm_min, tm.tm_sec);
} @@ -130,10 +132,10 @@ char menu[80]; char *ptr = menu;
- wmove(stdscr, SCREEN_Y - 1, 0);
wmove(menuwin, 1, 0);
for (j = 0; j < SCREEN_X; j++)
waddch(stdscr, ' ');
waddch(menuwin, ' ');
for (i = 0; i < ARRAY_SIZE(categories); i++) { if (categories[i].count == 0)
@@ -142,7 +144,7 @@ ptr += sprintf(ptr, "F%d: %s ", i + 1, categories[i].name); }
- mvprintw(23, 0, menu);
- mvwprintw(menuwin, 1, 0, menu);
#ifdef CONFIG_SHOW_DATE_TIME print_time_and_date(); @@ -192,7 +194,7 @@
wclear(modwin); cat->modules[cat->cur]->redraw(modwin);
- refresh();
- wrefresh(modwin);
}
static void handle_category_key(struct coreinfo_cat *cat, int key) @@ -219,6 +221,7 @@ int key;
center(0, "coreinfo v0.1");
refresh();
print_menu(); print_submenu(&categories[curwin]);
@@ -229,7 +232,7 @@ while (1) { #ifdef CONFIG_SHOW_DATE_TIME print_time_and_date();
refresh();
wrefresh(menuwin);
#endif
key = getch();
@@ -271,10 +274,12 @@ init_pair(2, COLOR_BLACK, COLOR_WHITE); init_pair(3, COLOR_WHITE, COLOR_WHITE);
- modwin = newwin(SCREEN_Y-2, SCREEN_X, 1, 0);
modwin = newwin(SCREEN_Y - 3, SCREEN_X, 1, 0);
menuwin = newwin(2, SCREEN_X, SCREEN_Y - 2, 0);
wattrset(stdscr, COLOR_PAIR(1) | A_BOLD); wattrset(modwin, COLOR_PAIR(2));
wattrset(menuwin, COLOR_PAIR(1) | A_BOLD);
for (i = 0; i < SCREEN_Y - 1; i++) { wmove(modwin, i - 1, 0);
@@ -283,7 +288,7 @@ waddch(modwin, ' '); }
- refresh();
wrefresh(modwin);
for (i = 0; i < ARRAY_SIZE(categories); i++) { for(j = 0; j < categories[i].count; j++)
-- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc.
-- coreboot mailing list coreboot@coreboot.org http://www.coreboot.org/mailman/listinfo/coreboot
Enable the ESC key to close coreinfo - useful if you are using a chooser and want to return to it.
Signed-off-by: Jordan Crouse jordan.crouse@amd.com Index: coreinfo/coreinfo.c =================================================================== --- coreinfo.orig/coreinfo.c 2008-05-13 14:52:50.000000000 -0600 +++ coreinfo/coreinfo.c 2008-05-13 14:52:54.000000000 -0600 @@ -256,6 +256,8 @@ } }
+ if (key == 0x1B) + return;
handle_category_key(&categories[curwin], key); }
-----Original Message----- From: coreboot-bounces@coreboot.org [mailto:coreboot-bounces@coreboot.org] On Behalf Of jordan.crouse@amd.com Sent: Tuesday, May 13, 2008 5:39 PM To: coreboot@coreboot.org Cc: Jordan Crouse Subject: [coreboot] [patch 2/2] coreinfo: Use the ESC key to exit the payload
Enable the ESC key to close coreinfo - useful if you are using a chooser and want to return to it.
Signed-off-by: Jordan Crouse jordan.crouse@amd.com
Acked-by: Myles Watson mylesgw@gmail.com
Is there another patch coming that tells the user to press ESC?
Thanks, Myles
Index: coreinfo/coreinfo.c
--- coreinfo.orig/coreinfo.c 2008-05-13 14:52:50.000000000 -0600 +++ coreinfo/coreinfo.c 2008-05-13 14:52:54.000000000 -0600 @@ -256,6 +256,8 @@ } }
if (key == 0x1B)
return;
handle_category_key(&categories[curwin], key); }
-- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc.
-- coreboot mailing list coreboot@coreboot.org http://www.coreboot.org/mailman/listinfo/coreboot
On 14/05/08 10:14 -0600, Myles Watson wrote:
-----Original Message----- From: coreboot-bounces@coreboot.org [mailto:coreboot-bounces@coreboot.org] On Behalf Of jordan.crouse@amd.com Sent: Tuesday, May 13, 2008 5:39 PM To: coreboot@coreboot.org Cc: Jordan Crouse Subject: [coreboot] [patch 2/2] coreinfo: Use the ESC key to exit the payload
Enable the ESC key to close coreinfo - useful if you are using a chooser and want to return to it.
Signed-off-by: Jordan Crouse jordan.crouse@amd.com
Acked-by: Myles Watson mylesgw@gmail.com
Is there another patch coming that tells the user to press ESC?
No, but such a patch can be made to appear... :)
Thanks, Myles
Index: coreinfo/coreinfo.c
--- coreinfo.orig/coreinfo.c 2008-05-13 14:52:50.000000000 -0600 +++ coreinfo/coreinfo.c 2008-05-13 14:52:54.000000000 -0600 @@ -256,6 +256,8 @@ } }
if (key == 0x1B)
return;
handle_category_key(&categories[curwin], key); }
-- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc.
-- coreboot mailing list coreboot@coreboot.org http://www.coreboot.org/mailman/listinfo/coreboot
On Tue, May 13, 2008 at 05:38:48PM -0600, jordan.crouse@amd.com wrote:
Enable the ESC key to close coreinfo - useful if you are using a chooser and want to return to it.
Signed-off-by: Jordan Crouse jordan.crouse@amd.com Index: coreinfo/coreinfo.c =================================================================== --- coreinfo.orig/coreinfo.c 2008-05-13 14:52:50.000000000 -0600 +++ coreinfo/coreinfo.c 2008-05-13 14:52:54.000000000 -0600 @@ -256,6 +256,8 @@ } }
if (key == 0x1B)
How about something like KEY_ESC? Doesn't seem to exist yet, but would be nice.
Uwe.
On 14/05/08 23:29 +0200, Uwe Hermann wrote:
On Tue, May 13, 2008 at 05:38:48PM -0600, jordan.crouse@amd.com wrote:
Enable the ESC key to close coreinfo - useful if you are using a chooser and want to return to it.
Signed-off-by: Jordan Crouse jordan.crouse@amd.com Index: coreinfo/coreinfo.c =================================================================== --- coreinfo.orig/coreinfo.c 2008-05-13 14:52:50.000000000 -0600 +++ coreinfo/coreinfo.c 2008-05-13 14:52:54.000000000 -0600 @@ -256,6 +256,8 @@ } }
if (key == 0x1B)
How about something like KEY_ESC? Doesn't seem to exist yet, but would be nice.
I agree - I'm not sure why its not in curses.h - but its not, not even on my system.
What is our policy for changes like this to curses.h? How closely do we want to stick with the canonical version that everybody else uses?
Jordan
Uwe.
http://www.hermann-uwe.de | http://www.holsham-traders.de http://www.crazy-hacks.org | http://www.unmaintained-free-software.org
Am Wed, 14 May 2008 15:55:35 -0600 schrieb Jordan Crouse jordan.crouse@amd.com:
What is our policy for changes like this to curses.h? How closely do we want to stick with the canonical version that everybody else uses?
Add new features to curses_coreboot.h or curses_extra.h or so. If only to prevent issues once the code gets some update using foreign sources (and suddenly local additions are missing)
Patrick