acpi_quirks2h.awk (139825) | acpi_quirks2h.awk (167814) |
---|---|
1#!/usr/bin/awk -f 2# | 1#!/usr/bin/awk -f 2# |
3# $FreeBSD: head/sys/tools/acpi_quirks2h.awk 139825 2005-01-07 02:29:27Z imp $ | 3# $FreeBSD: head/sys/tools/acpi_quirks2h.awk 167814 2007-03-22 18:16:43Z jkim $ |
4 5#- 6# Copyright (c) 2004 Mark Santcroos <marks@ripe.net> 7# All rights reserved. 8# 9# Redistribution and use in source and binary forms, with or without 10# modification, are permitted provided that the following conditions 11# are met: --- 61 unchanged lines hidden (view full) --- 73 OEM_ID = substr($0, M, RLENGTH); 74 75 # Parse OEM Table ID 76 ANCHOR = LENGTH - (M + RLENGTH - 1); 77 REMAINDER = substr($0, M + RLENGTH, ANCHOR); 78 M = match (REMAINDER, /\"[^\"]*\"/); 79 OEM_TABLE_ID = substr(REMAINDER, M, RLENGTH); 80 | 4 5#- 6# Copyright (c) 2004 Mark Santcroos <marks@ripe.net> 7# All rights reserved. 8# 9# Redistribution and use in source and binary forms, with or without 10# modification, are permitted provided that the following conditions 11# are met: --- 61 unchanged lines hidden (view full) --- 73 OEM_ID = substr($0, M, RLENGTH); 74 75 # Parse OEM Table ID 76 ANCHOR = LENGTH - (M + RLENGTH - 1); 77 REMAINDER = substr($0, M + RLENGTH, ANCHOR); 78 M = match (REMAINDER, /\"[^\"]*\"/); 79 OEM_TABLE_ID = substr(REMAINDER, M, RLENGTH); 80 |
81 printf("\t{ ACPI_TABLE_%s, OEM, {%s}, {%s} },\n", | 81 printf("\t{ \"%s\", OEM, {%s}, {%s} },\n", |
82 TABLE, OEM_ID, OEM_TABLE_ID) > OUTPUT; 83} 84 85# 86# CREATOR field 87# 88$1 == "creator:" { 89 # Parse table type to match 90 TABLE = $2; 91 92 M = match ($0, /\"[^\"]*\"/); 93 CREATOR = substr($0, M, RLENGTH); 94 | 82 TABLE, OEM_ID, OEM_TABLE_ID) > OUTPUT; 83} 84 85# 86# CREATOR field 87# 88$1 == "creator:" { 89 # Parse table type to match 90 TABLE = $2; 91 92 M = match ($0, /\"[^\"]*\"/); 93 CREATOR = substr($0, M, RLENGTH); 94 |
95 printf("\t{ ACPI_TABLE_%s, CREATOR, {%s} },\n", | 95 printf("\t{ \"%s\", CREATOR, {%s} },\n", |
96 TABLE, CREATOR) > OUTPUT; 97} 98 99# 100# OEM REVISION field 101# 102$1 == "oem_rev:" { 103 TABLE = $2; 104 SIGN = $3; 105 VALUE = $4; 106 107 # Parse operand 108 OPERAND = trans_sign(SIGN); 109 | 96 TABLE, CREATOR) > OUTPUT; 97} 98 99# 100# OEM REVISION field 101# 102$1 == "oem_rev:" { 103 TABLE = $2; 104 SIGN = $3; 105 VALUE = $4; 106 107 # Parse operand 108 OPERAND = trans_sign(SIGN); 109 |
110 printf("\t{ ACPI_TABLE_%s, OEM_REV, {.op = %s}, {.rev = %s} },\n", | 110 printf("\t{ \"%s\", OEM_REV, {.op = %s}, {.rev = %s} },\n", |
111 TABLE, OPERAND, VALUE) > OUTPUT; 112} 113 114# 115# CREATOR REVISION field 116# 117$1 == "creator_rev:" { 118 TABLE = $2; 119 SIGN = $3; 120 VALUE = $4; 121 122 # Parse operand 123 OPERAND = trans_sign(SIGN); 124 | 111 TABLE, OPERAND, VALUE) > OUTPUT; 112} 113 114# 115# CREATOR REVISION field 116# 117$1 == "creator_rev:" { 118 TABLE = $2; 119 SIGN = $3; 120 VALUE = $4; 121 122 # Parse operand 123 OPERAND = trans_sign(SIGN); 124 |
125 printf("\t{ ACPI_TABLE_%s, CREATOR_REV, {.op = %s}, {.rev = %s} },\n", | 125 printf("\t{ \"%s\", CREATOR_REV, {.op = %s}, {.rev = %s} },\n", |
126 TABLE, OPERAND, VALUE) > OUTPUT; 127} 128 129# 130# QUIRKS field: This is the last line of every entry 131# 132$1 == "quirks:" { | 126 TABLE, OPERAND, VALUE) > OUTPUT; 127} 128 129# 130# QUIRKS field: This is the last line of every entry 131# 132$1 == "quirks:" { |
133 printf("\t{ ACPI_TABLE_END }\n};\n\n") > OUTPUT; | 133 printf("\t{ \"\" }\n};\n\n") > OUTPUT; |
134 135 QUIRKS = $0; 136 sub(/^quirks:[ ]*/ , "", QUIRKS); 137 138 QUIRK_COUNT++; 139 QUIRK_LIST[QUIRK_COUNT] = QUIRKS; 140 QUIRK_NAME[QUIRK_COUNT] = ENTRY_NAME; 141} --- 46 unchanged lines hidden --- | 134 135 QUIRKS = $0; 136 sub(/^quirks:[ ]*/ , "", QUIRKS); 137 138 QUIRK_COUNT++; 139 QUIRK_LIST[QUIRK_COUNT] = QUIRKS; 140 QUIRK_NAME[QUIRK_COUNT] = ENTRY_NAME; 141} --- 46 unchanged lines hidden --- |