src/arch/x86/boot/acpigen.c: Small coding style and comment fixes
While reading through the file fix some spotted errors like indentation, locution(?), capitalization and missing full stops. Change-Id: Id435b4750e329b06a9b36c1df2c39d2038a09b18 Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-on: http://review.coreboot.org/2484 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martin.roth@se-eng.com> Reviewed-by: Marc Jones <marc.jones@se-eng.com>
This commit is contained in:
parent
d59fc5340e
commit
0f4c0e2669
|
@ -17,11 +17,13 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* how many nesting we support */
|
||||
/* How much nesting do we support? */
|
||||
#define ACPIGEN_LENSTACK_SIZE 10
|
||||
|
||||
/* if you need to change this, change the acpigen_write_f and
|
||||
acpigen_patch_len */
|
||||
/*
|
||||
* If you need to change this, change acpigen_write_f and
|
||||
* acpigen_patch_len
|
||||
*/
|
||||
|
||||
#define ACPIGEN_MAXLEN 0xfff
|
||||
|
||||
|
@ -148,9 +150,13 @@ int acpigen_emit_stream(const char *data, int size)
|
|||
return size;
|
||||
}
|
||||
|
||||
/* The NameString are bit tricky, each element can be 4 chars, if
|
||||
less its padded with underscore. Check 18.2.2 and 18.4
|
||||
and 5.3 of ACPI specs 3.0 for details
|
||||
/*
|
||||
* The naming conventions for ACPI namespace names are a bit tricky as
|
||||
* each element has to be 4 chars wide (»All names are a fixed 32 bits.«)
|
||||
* and »By convention, when an ASL compiler pads a name shorter than 4
|
||||
* characters, it is done so with trailing underscores (‘_’).«.
|
||||
*
|
||||
* Check sections 5.3, 18.2.2 and 18.4 of ACPI spec 3.0 for details.
|
||||
*/
|
||||
|
||||
static int acpigen_emit_simple_namestring(const char *name) {
|
||||
|
@ -205,13 +211,13 @@ int acpigen_emit_namestring(const char *namepath) {
|
|||
int dotpos = 0;
|
||||
int len = 0;
|
||||
|
||||
/* we can start with a \ */
|
||||
/* We can start with a »\«. */
|
||||
if (namepath[0] == '\\') {
|
||||
len += acpigen_emit_byte('\\');
|
||||
namepath++;
|
||||
}
|
||||
|
||||
/* and there can be any number of ^ */
|
||||
/* And there can be any number of »^«. */
|
||||
while (namepath[0] == '^') {
|
||||
len += acpigen_emit_byte('^');
|
||||
namepath++;
|
||||
|
@ -370,7 +376,9 @@ int acpigen_write_empty_PTC(void)
|
|||
return len + nlen;
|
||||
}
|
||||
|
||||
/* generates a func with max supported P states */
|
||||
/*
|
||||
* Generates a func with max supported P-states.
|
||||
*/
|
||||
int acpigen_write_PPC(u8 nr)
|
||||
{
|
||||
/*
|
||||
|
@ -396,7 +404,10 @@ int acpigen_write_PPC(u8 nr)
|
|||
return len;
|
||||
}
|
||||
|
||||
/* generates a func with max supported P states */
|
||||
/*
|
||||
* Generates a func with max supported P-states saved
|
||||
* in the variable PPCM.
|
||||
*/
|
||||
int acpigen_write_PPC_NVS(void)
|
||||
{
|
||||
/*
|
||||
|
@ -621,7 +632,7 @@ int acpigen_write_io16(u16 min, u16 max, u8 align, u8 len, u8 decode16)
|
|||
* Bit2-0: 111 (0x7) => 7 Bytes long
|
||||
*/
|
||||
acpigen_emit_byte(0x47);
|
||||
/* does the device decode all 16 or just 10 bits? */
|
||||
/* Does the device decode all 16 or just 10 bits? */
|
||||
/* bit1-7 are ignored */
|
||||
acpigen_emit_byte(decode16 ? 0x01 : 0x00);
|
||||
/* minimum base address the device may be configured for */
|
||||
|
@ -642,7 +653,7 @@ int acpigen_write_resourcetemplate_header(void)
|
|||
/*
|
||||
* A ResourceTemplate() is a Buffer() with a
|
||||
* (Byte|Word|DWord) containing the length, followed by one or more
|
||||
* resource items, terminated by the end tag
|
||||
* resource items, terminated by the end tag.
|
||||
* (small item 0xf, len 1)
|
||||
*/
|
||||
len = acpigen_emit_byte(0x11); /* Buffer opcode */
|
||||
|
@ -700,13 +711,13 @@ int acpigen_write_mainboard_resource_template(void)
|
|||
len = acpigen_write_resourcetemplate_header();
|
||||
start = acpigen_get_current();
|
||||
|
||||
/* Add reserved memory ranges */
|
||||
/* Add reserved memory ranges. */
|
||||
search_global_resources(
|
||||
IORESOURCE_MEM | IORESOURCE_RESERVE,
|
||||
IORESOURCE_MEM | IORESOURCE_RESERVE,
|
||||
acpigen_add_mainboard_rsvd_mem32, 0);
|
||||
|
||||
/* Add reserved io ranges */
|
||||
/* Add reserved io ranges. */
|
||||
search_global_resources(
|
||||
IORESOURCE_IO | IORESOURCE_RESERVE,
|
||||
IORESOURCE_IO | IORESOURCE_RESERVE,
|
||||
|
|
Loading…
Reference in New Issue