aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Patterson <andrew.patterson@hp.com>2010-03-10 16:01:01 +0800
committerHuang Ying <ying.huang@intel.com>2010-03-10 16:01:01 +0800
commit2e98a2b5fd65b51144337a595e3c731507633f43 (patch)
treefb91b2f70b743238eea2eff15786852c58c84fa0
parent2a78abc1c40e7d5a57e34bfd5ff6a841757b42cf (diff)
downloadaer-inject-2e98a2b5fd65b51144337a595e3c731507633f43.tar.gz
aer-inject: use aliases for various keywords
Introduce aliases for some of the longer-length keywords: PCI_ID = ID COR_STATUS = COR = CORRECTABLE UNCOR_STATUS = UNCOR = UNCORRECTABLE HEADER_LOG = HL Signed-off-by: Andrew Patterson <andrew.patterson@hp.com> Signed-off-by: Huang Ying <ying.huang@intel.com>
-rw-r--r--SPEC9
-rw-r--r--aer.lex7
2 files changed, 16 insertions, 0 deletions
diff --git a/SPEC b/SPEC
index d2c66db..bcce21b 100644
--- a/SPEC
+++ b/SPEC
@@ -67,3 +67,12 @@ For all missing fields reasonable default values are filled in
(hopefully).
Comments start with # until the end of the line.
+
+Keywords are case-insensitive.
+
+There are aliases for some of the longer keywords:
+
+ PCI_ID = ID
+ COR_STATUS = COR = CORRECTABLE
+ UNCOR_STATUS = UNCOR = UNCORRECTABLE
+ HEADER_LOG = HL
diff --git a/aer.lex b/aer.lex
index a2dea48..6121e4e 100644
--- a/aer.lex
+++ b/aer.lex
@@ -54,6 +54,7 @@ static struct key {
int32_t val;
} keys[] = {
#define KEY(x) { #x, x }
+#define ALIAS(x, y) { #x, y }
#define KEYVAL(x,v) { #x, x, v }
KEY(AER),
KEY(DOMAIN),
@@ -61,9 +62,15 @@ static struct key {
KEY(DEV),
KEY(FN),
KEY(PCI_ID),
+ ALIAS(ID, PCI_ID),
KEY(UNCOR_STATUS),
+ ALIAS(UNCOR, UNCOR_STATUS),
+ ALIAS(UNCORRECTABLE, UNCOR_STATUS),
KEY(COR_STATUS),
+ ALIAS(COR, COR_STATUS),
+ ALIAS(CORRECTABLE, COR_STATUS),
KEY(HEADER_LOG),
+ ALIAS(HL, HEADER_LOG),
KEYVAL(TRAIN,PCI_ERR_UNC_TRAIN),
KEYVAL(DLP, PCI_ERR_UNC_DLP),
KEYVAL(POISON_TLP, PCI_ERR_UNC_POISON_TLP),