util: Fix typo on plural form of index
Change-Id: Idc165f8eafacf3130a29b701bc3610c1a67f69d5 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/32855 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jacob Garber <jgarber1@ualberta.ca>
This commit is contained in:
parent
cc8665eacc
commit
bd96a84300
|
@ -14111,9 +14111,9 @@ static void compute_closure_variables(struct compile_state *state,
|
||||||
struct block *block;
|
struct block *block;
|
||||||
struct triple *old_result, *first, *ins;
|
struct triple *old_result, *first, *ins;
|
||||||
size_t count, idx;
|
size_t count, idx;
|
||||||
unsigned long used_indicies;
|
unsigned long used_indices;
|
||||||
int i, max_index;
|
int i, max_index;
|
||||||
#define MAX_INDICIES (sizeof(used_indicies)*CHAR_BIT)
|
#define MAX_INDICES (sizeof(used_indices)*CHAR_BIT)
|
||||||
#define ID_BITS(X) ((X) & (TRIPLE_FLAG_LOCAL -1))
|
#define ID_BITS(X) ((X) & (TRIPLE_FLAG_LOCAL -1))
|
||||||
struct {
|
struct {
|
||||||
unsigned id;
|
unsigned id;
|
||||||
|
@ -14183,7 +14183,7 @@ static void compute_closure_variables(struct compile_state *state,
|
||||||
*
|
*
|
||||||
* To gurantee that stability I lookup the variables
|
* To gurantee that stability I lookup the variables
|
||||||
* to see where they have been used before and
|
* to see where they have been used before and
|
||||||
* I build my final list with the assigned indicies.
|
* I build my final list with the assigned indices.
|
||||||
*/
|
*/
|
||||||
vars = 0;
|
vars = 0;
|
||||||
if (enclose_triple(old_result)) {
|
if (enclose_triple(old_result)) {
|
||||||
|
@ -14202,8 +14202,8 @@ static void compute_closure_variables(struct compile_state *state,
|
||||||
ordered_triple_set(&vars, set->member);
|
ordered_triple_set(&vars, set->member);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Lookup the current indicies of the live varialbe */
|
/* Lookup the current indices of the live varialbe */
|
||||||
used_indicies = 0;
|
used_indices = 0;
|
||||||
max_index = -1;
|
max_index = -1;
|
||||||
for(set = vars; set ; set = set->next) {
|
for(set = vars; set ; set = set->next) {
|
||||||
struct triple *ins;
|
struct triple *ins;
|
||||||
|
@ -14214,14 +14214,14 @@ static void compute_closure_variables(struct compile_state *state,
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (index >= MAX_INDICIES) {
|
if (index >= MAX_INDICES) {
|
||||||
internal_error(state, ins, "index unexpectedly large");
|
internal_error(state, ins, "index unexpectedly large");
|
||||||
}
|
}
|
||||||
if (used_indicies & (1 << index)) {
|
if (used_indices & (1 << index)) {
|
||||||
internal_error(state, ins, "index previously used?");
|
internal_error(state, ins, "index previously used?");
|
||||||
}
|
}
|
||||||
/* Remember which indicies have been used */
|
/* Remember which indices have been used */
|
||||||
used_indicies |= (1 << index);
|
used_indices |= (1 << index);
|
||||||
if (index > max_index) {
|
if (index > max_index) {
|
||||||
max_index = index;
|
max_index = index;
|
||||||
}
|
}
|
||||||
|
@ -14239,31 +14239,31 @@ static void compute_closure_variables(struct compile_state *state,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/* Find the lowest unused index value */
|
/* Find the lowest unused index value */
|
||||||
for(index = 0; index < MAX_INDICIES; index++) {
|
for(index = 0; index < MAX_INDICES; index++) {
|
||||||
if (!(used_indicies & ((uint64_t)1 << index))) {
|
if (!(used_indices & ((uint64_t)1 << index))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (index == MAX_INDICIES) {
|
if (index == MAX_INDICES) {
|
||||||
internal_error(state, ins, "no free indicies?");
|
internal_error(state, ins, "no free indices?");
|
||||||
}
|
}
|
||||||
info[ID_BITS(ins->id)].index = index;
|
info[ID_BITS(ins->id)].index = index;
|
||||||
/* Remember which indicies have been used */
|
/* Remember which indices have been used */
|
||||||
used_indicies |= (1 << index);
|
used_indices |= (1 << index);
|
||||||
if (index > max_index) {
|
if (index > max_index) {
|
||||||
max_index = index;
|
max_index = index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Build the return list of variables with positions matching
|
/* Build the return list of variables with positions matching
|
||||||
* their indicies.
|
* their indices.
|
||||||
*/
|
*/
|
||||||
*enclose = 0;
|
*enclose = 0;
|
||||||
last_var = enclose;
|
last_var = enclose;
|
||||||
for(i = 0; i <= max_index; i++) {
|
for(i = 0; i <= max_index; i++) {
|
||||||
struct triple *var;
|
struct triple *var;
|
||||||
var = 0;
|
var = 0;
|
||||||
if (used_indicies & (1 << i)) {
|
if (used_indices & (1 << i)) {
|
||||||
for(set = vars; set; set = set->next) {
|
for(set = vars; set; set = set->next) {
|
||||||
int index;
|
int index;
|
||||||
index = info[ID_BITS(set->member->id)].index;
|
index = info[ID_BITS(set->member->id)].index;
|
||||||
|
|
|
@ -156,7 +156,7 @@ static const struct mem_param *spd_set_memclk(void)
|
||||||
unsigned device;
|
unsigned device;
|
||||||
uint32_t value;
|
uint32_t value;
|
||||||
|
|
||||||
static const int latency_indicies[] = { 26, 23, 9 };
|
static const int latency_indices[] = { 26, 23, 9 };
|
||||||
static const unsigned char min_cycle_times[] = {
|
static const unsigned char min_cycle_times[] = {
|
||||||
[NBCAP_MEMCLK_200MHZ] = 0x50, /* 5ns */
|
[NBCAP_MEMCLK_200MHZ] = 0x50, /* 5ns */
|
||||||
[NBCAP_MEMCLK_166MHZ] = 0x60, /* 6ns */
|
[NBCAP_MEMCLK_166MHZ] = 0x60, /* 6ns */
|
||||||
|
@ -224,7 +224,7 @@ static const struct mem_param *spd_set_memclk(void)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
debug('D');
|
debug('D');
|
||||||
value = smbus_read_byte(device, latency_indicies[index]);
|
value = smbus_read_byte(device, latency_indices[index]);
|
||||||
if (value < 0) continue;
|
if (value < 0) continue;
|
||||||
|
|
||||||
debug('E');
|
debug('E');
|
||||||
|
@ -310,7 +310,7 @@ static const struct mem_param *spd_set_memclk(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read the min_cycle_time for this latency */
|
/* Read the min_cycle_time for this latency */
|
||||||
value = smbus_read_byte(device, latency_indicies[index]);
|
value = smbus_read_byte(device, latency_indices[index]);
|
||||||
|
|
||||||
/* All is good if the selected clock speed
|
/* All is good if the selected clock speed
|
||||||
* is what I need or slower.
|
* is what I need or slower.
|
||||||
|
|
|
@ -1621,7 +1621,7 @@ static const struct mem_param *spd_set_memclk(const struct mem_controller *ctrl)
|
||||||
unsigned min_cycle_time, min_latency;
|
unsigned min_cycle_time, min_latency;
|
||||||
int i;
|
int i;
|
||||||
uint32_t value;
|
uint32_t value;
|
||||||
static const int latency_indicies[] = { 26, 23, 9 };
|
static const int latency_indices[] = { 26, 23, 9 };
|
||||||
static const unsigned char min_cycle_times[] = {
|
static const unsigned char min_cycle_times[] = {
|
||||||
[0 ] = 0x50,
|
[0 ] = 0x50,
|
||||||
[1 ] = 0x60,
|
[1 ] = 0x60,
|
||||||
|
@ -1651,7 +1651,7 @@ static const struct mem_param *spd_set_memclk(const struct mem_controller *ctrl)
|
||||||
(!(latencies & (1 << latency)))) {
|
(!(latencies & (1 << latency)))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
value = spd_read_byte(ctrl->channel0[i], latency_indicies[index]);
|
value = spd_read_byte(ctrl->channel0[i], latency_indices[index]);
|
||||||
if (value < 0) {
|
if (value < 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1701,7 +1701,7 @@ static const struct mem_param *spd_set_memclk(const struct mem_controller *ctrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
value = spd_read_byte(ctrl->channel0[i], latency_indicies[index]);
|
value = spd_read_byte(ctrl->channel0[i], latency_indices[index]);
|
||||||
|
|
||||||
|
|
||||||
if (value <= min_cycle_time) {
|
if (value <= min_cycle_time) {
|
||||||
|
|
|
@ -1626,7 +1626,7 @@ static const struct mem_param *spd_set_memclk(const struct mem_controller *ctrl)
|
||||||
unsigned min_cycle_time, min_latency;
|
unsigned min_cycle_time, min_latency;
|
||||||
int i;
|
int i;
|
||||||
uint32_t value;
|
uint32_t value;
|
||||||
static const int latency_indicies[] = { 26, 23, 9 };
|
static const int latency_indices[] = { 26, 23, 9 };
|
||||||
static const unsigned char min_cycle_times[] = {
|
static const unsigned char min_cycle_times[] = {
|
||||||
[0 ] = 0x50,
|
[0 ] = 0x50,
|
||||||
[1 ] = 0x60,
|
[1 ] = 0x60,
|
||||||
|
@ -1656,7 +1656,7 @@ static const struct mem_param *spd_set_memclk(const struct mem_controller *ctrl)
|
||||||
(!(latencies & (1 << latency)))) {
|
(!(latencies & (1 << latency)))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
value = spd_read_byte(ctrl->channel0[i], latency_indicies[index]);
|
value = spd_read_byte(ctrl->channel0[i], latency_indices[index]);
|
||||||
if (value < 0) {
|
if (value < 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1706,7 +1706,7 @@ static const struct mem_param *spd_set_memclk(const struct mem_controller *ctrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
value = spd_read_byte(ctrl->channel0[i], latency_indicies[index]);
|
value = spd_read_byte(ctrl->channel0[i], latency_indices[index]);
|
||||||
|
|
||||||
|
|
||||||
if (value <= min_cycle_time) {
|
if (value <= min_cycle_time) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
static void spd_set_memclk(void)
|
static void spd_set_memclk(void)
|
||||||
{
|
{
|
||||||
static const int indicies[] = { 26, 23, 9 };
|
static const int indices[] = { 26, 23, 9 };
|
||||||
int new_cycle_time, new_latency;
|
int new_cycle_time, new_latency;
|
||||||
int index;
|
int index;
|
||||||
unsigned min_cycle_time, min_latency;
|
unsigned min_cycle_time, min_latency;
|
||||||
|
@ -15,7 +15,7 @@ static void spd_set_memclk(void)
|
||||||
for(index = 0; index < 3; index++) {
|
for(index = 0; index < 3; index++) {
|
||||||
unsigned long loops;
|
unsigned long loops;
|
||||||
unsigned long address;
|
unsigned long address;
|
||||||
address = indicies[index];
|
address = indices[index];
|
||||||
loops = 1000000;
|
loops = 1000000;
|
||||||
do {
|
do {
|
||||||
} while(--loops);
|
} while(--loops);
|
||||||
|
|
|
@ -569,7 +569,7 @@ static const struct mem_param *spd_set_memclk(void)
|
||||||
unsigned device;
|
unsigned device;
|
||||||
uint32_t value;
|
uint32_t value;
|
||||||
|
|
||||||
static const int latency_indicies[] = { 26, 23, 9 };
|
static const int latency_indices[] = { 26, 23, 9 };
|
||||||
static const unsigned char min_cycle_times[] = {
|
static const unsigned char min_cycle_times[] = {
|
||||||
[NBCAP_MEMCLK_200MHZ] = 0x50, /* 5ns */
|
[NBCAP_MEMCLK_200MHZ] = 0x50, /* 5ns */
|
||||||
[NBCAP_MEMCLK_166MHZ] = 0x60, /* 6ns */
|
[NBCAP_MEMCLK_166MHZ] = 0x60, /* 6ns */
|
||||||
|
@ -637,7 +637,7 @@ static const struct mem_param *spd_set_memclk(void)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
debug('D');
|
debug('D');
|
||||||
value = smbus_read_byte(device, latency_indicies[index]);
|
value = smbus_read_byte(device, latency_indices[index]);
|
||||||
if (value < 0) continue;
|
if (value < 0) continue;
|
||||||
|
|
||||||
debug('E');
|
debug('E');
|
||||||
|
@ -723,7 +723,7 @@ static const struct mem_param *spd_set_memclk(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read the min_cycle_time for this latency */
|
/* Read the min_cycle_time for this latency */
|
||||||
value = smbus_read_byte(device, latency_indicies[index]);
|
value = smbus_read_byte(device, latency_indices[index]);
|
||||||
|
|
||||||
/* All is good if the selected clock speed
|
/* All is good if the selected clock speed
|
||||||
* is what I need or slower.
|
* is what I need or slower.
|
||||||
|
|
|
@ -223,7 +223,7 @@ func (cw *cWriter) WritePageEntry(data interface{}) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// This map represents what the IA32_PAT MSR should be at runtime. The indicies
|
// This map represents what the IA32_PAT MSR should be at runtime. The indices
|
||||||
// are what the linux kernel uses. Reserved entries are not used.
|
// are what the linux kernel uses. Reserved entries are not used.
|
||||||
// 0 WB : _PAGE_CACHE_MODE_WB
|
// 0 WB : _PAGE_CACHE_MODE_WB
|
||||||
// 1 WC : _PAGE_CACHE_MODE_WC
|
// 1 WC : _PAGE_CACHE_MODE_WC
|
||||||
|
@ -523,11 +523,11 @@ func newAddrSpace(mergeFunc addrRangeMerge, metatdataBaseAddr uint64) *addressSp
|
||||||
return as
|
return as
|
||||||
}
|
}
|
||||||
|
|
||||||
func (as *addressSpace) deleteEntries(indicies []int) {
|
func (as *addressSpace) deleteEntries(indices []int) {
|
||||||
// deletions need to be processed in reverse order so as not
|
// deletions need to be processed in reverse order so as not
|
||||||
// delete the wrong entries
|
// delete the wrong entries
|
||||||
sort.Sort(sort.Reverse(sort.IntSlice(indicies)))
|
sort.Sort(sort.Reverse(sort.IntSlice(indices)))
|
||||||
for _, i := range indicies {
|
for _, i := range indices {
|
||||||
as.ranges = append(as.ranges[:i], as.ranges[i+1:]...)
|
as.ranges = append(as.ranges[:i], as.ranges[i+1:]...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue