MCPcopy Create free account
hub / github.com/coreboot/coreboot / pci_module_redraw

Function pci_module_redraw

payloads/coreinfo/pci_module.c:90–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90static int pci_module_redraw(WINDOW *win)
91{
92 unsigned int bus, slot, func;
93 int i;
94
95 print_module_title(win, "PCI Device List");
96
97 for (i = 0; i < MENU_VISIBLE; i++) {
98 int item = menu_first + i;
99
100 /* Draw a blank space. */
101 if (item >= devices_index) {
102 wattrset(win, COLOR_PAIR(2));
103 mvwprintw(win, 2 + i, 1, " ");
104 continue;
105 }
106
107 bus = PCI_BUS(devices[item].device);
108 slot = PCI_SLOT(devices[item].device);
109 func = PCI_FUNC(devices[item].device);
110
111 if (item == menu_selected)
112 wattrset(win, COLOR_PAIR(3) | A_BOLD);
113 else
114 wattrset(win, COLOR_PAIR(2));
115
116 mvwprintw(win, 2 + i, 1, "%X:%2.2X.%2.2X %04X:%04X ",
117 bus, slot, func,
118 devices[item].id & 0xffff,
119 (devices[item].id >> 16) & 0xffff);
120
121 wattrset(win, COLOR_PAIR(2));
122
123 if (i == 0) {
124 if (item != 0)
125 mvwaddch(win, 2 + i, 19, ACS_UARROW);
126 }
127 if (i == MENU_VISIBLE - 1) {
128 if ((item + 1) < devices_index)
129 mvwaddch(win, 2 + i, 19, ACS_DARROW);
130 }
131 }
132
133 wattrset(win, COLOR_PAIR(2));
134
135 for (i = 0; i < 16; i++)
136 mvwprintw(win, 2, 26 + (i * 3), "%2.2X ", i);
137
138 wmove(win, 3, 25);
139
140 for (i = 0; i < 48; i++)
141 waddch(win, (i == 0) ? ACS_ULCORNER : ACS_HLINE);
142
143 for (i = 0; i < 16; i++) {
144 mvwprintw(win, 4 + i, 23, "%2.2X", i * 16);
145 wmove(win, 4 + i, 25);
146 waddch(win, ACS_VLINE);
147 }

Callers

nothing calls this directly

Calls 7

print_module_titleFunction · 0.85
wattrsetFunction · 0.85
mvwaddchFunction · 0.85
show_config_spaceFunction · 0.85
mvwprintwFunction · 0.50
wmoveFunction · 0.50
waddchFunction · 0.50

Tested by

no test coverage detected