summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2014-11-09 03:32:58 +0100
committerVladimir Serbinenko <phcoder@gmail.com>2014-11-22 16:57:37 +0100
commita09f4db396e18b26f48fb99a0b85fec4642236e6 (patch)
tree4322701ed50aa83206b3bfcdb67e85c4a0f0cc34 /src/arch/x86
parent2a19fb1d76c42cb516a4ab6f253de8c65d8cc3ad (diff)
acpigen: Use implicit length patching in acpigen.c
Change-Id: I0aa333911edabd5c9f844a2171dfa9fafe7de785 Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/7364 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/boot/acpigen.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/arch/x86/boot/acpigen.c b/src/arch/x86/boot/acpigen.c
index cc9f9abc48..8e7ce463c1 100644
--- a/src/arch/x86/boot/acpigen.c
+++ b/src/arch/x86/boot/acpigen.c
@@ -391,7 +391,7 @@ int acpigen_write_empty_PTC(void)
len += acpigen_write_resourcetemplate_footer();
len += rlen;
- acpigen_patch_len(len - 1);
+ acpigen_pop_len();
return len + nlen;
}
@@ -440,7 +440,7 @@ int acpigen_write_PPC(u8 nr)
len += acpigen_write_byte(nr);
/* add all single bytes */
len += 1;
- acpigen_patch_len(len - 1);
+ acpigen_pop_len();
return len;
}
@@ -465,7 +465,7 @@ int acpigen_write_PPC_NVS(void)
len += acpigen_emit_namestring("PPCM");
/* add all single bytes */
len += 1;
- acpigen_patch_len(len - 1);
+ acpigen_pop_len();
return len;
}
@@ -483,7 +483,7 @@ int acpigen_write_TPC(const char *gnvs_tpc_limit)
len = acpigen_write_method("_TPC", 0);
len += acpigen_emit_byte(0xa4); /* ReturnOp */
len += acpigen_emit_namestring(gnvs_tpc_limit);
- acpigen_patch_len(len - 1);
+ acpigen_pop_len();
return len;
}
@@ -499,7 +499,7 @@ int acpigen_write_PSS_package(u32 coreFreq, u32 power, u32 transLat,
len += acpigen_write_dword(control);
len += acpigen_write_dword(status);
// pkglen without the len opcode
- acpigen_patch_len(len - 1);
+ acpigen_pop_len();
printk(BIOS_DEBUG, "PSS: %uMHz power %u control 0x%x status 0x%x\n",
coreFreq, power, control, status);
@@ -518,9 +518,9 @@ int acpigen_write_PSD_package(u32 domain, u32 numprocs, PSD_coord coordtype)
len += acpigen_write_dword(domain);
len += acpigen_write_dword(coordtype);
len += acpigen_write_dword(numprocs);
- acpigen_patch_len(len - 1);
+ acpigen_pop_len();
len += lenp;
- acpigen_patch_len(len - 1);
+ acpigen_pop_len();
return len + lenh;
}
@@ -540,7 +540,7 @@ int acpigen_write_CST_package_entry(acpi_cstate_t *cstate)
len += acpigen_write_dword(cstate->ctype);
len += acpigen_write_dword(cstate->latency);
len += acpigen_write_dword(cstate->power);
- acpigen_patch_len(len - 1);
+ acpigen_pop_len();
return len;
}
@@ -555,7 +555,7 @@ int acpigen_write_CST_package(acpi_cstate_t *cstate, int nentries)
len += acpigen_write_CST_package_entry(cstate + i);
len += lenp;
- acpigen_patch_len(len - 1);
+ acpigen_pop_len();
return len + lenh;
}
@@ -582,12 +582,12 @@ int acpigen_write_TSS_package(int entries, acpi_tstate_t *tstate_list)
len += acpigen_write_dword(tstate->latency);
len += acpigen_write_dword(tstate->control);
len += acpigen_write_dword(tstate->status);
- acpigen_patch_len(len - 1);
+ acpigen_pop_len();
tstate++;
plen += len;
}
- acpigen_patch_len(plen - 1);
+ acpigen_pop_len();
return plen + nlen;
}
@@ -602,9 +602,9 @@ int acpigen_write_TSD_package(u32 domain, u32 numprocs, PSD_coord coordtype)
len += acpigen_write_dword(domain);
len += acpigen_write_dword(coordtype);
len += acpigen_write_dword(numprocs);
- acpigen_patch_len(len - 1);
+ acpigen_pop_len();
len += lenp;
- acpigen_patch_len(len - 1);
+ acpigen_pop_len();
return len + lenh;
}
@@ -732,7 +732,7 @@ int acpigen_write_resourcetemplate_footer(void)
p[0] = len & 0xff;
p[1] = (len >> 8) & 0xff;
/* patch len field */
- acpigen_patch_len(len-1);
+ acpigen_pop_len();
return 2;
}
@@ -787,7 +787,7 @@ int acpigen_write_mainboard_resources(const char *scope, const char *name)
len = acpigen_write_scope(scope);
len += acpigen_write_name(name);
len += acpigen_write_mainboard_resource_template();
- acpigen_patch_len(len - 1);
+ acpigen_pop_len();
return len;
}