diff options
author | Huang Ying <ying.huang@intel.com> | 2011-02-21 13:54:41 +0800 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-03-21 22:59:06 -0400 |
commit | 885b976fada5bc6595a9fd3e67e3cb1a3d11f50b (patch) | |
tree | 8b598bd3b265c0bbe8237e129410fdc80fe7847a /include/acpi | |
parent | dd9c1549edef02290edced639f67b54a25abbe0e (diff) | |
download | linux-885b976fada5bc6595a9fd3e67e3cb1a3d11f50b.tar.gz linux-885b976fada5bc6595a9fd3e67e3cb1a3d11f50b.tar.bz2 linux-885b976fada5bc6595a9fd3e67e3cb1a3d11f50b.zip |
ACPI, APEI, Add ERST record ID cache
APEI ERST firmware interface and implementation has no multiple users
in mind. For example, if there is four records in storage with ID: 1,
2, 3 and 4, if two ERST readers enumerate the records via
GET_NEXT_RECORD_ID as follow,
reader 1 reader 2
1
2
3
4
-1
-1
where -1 signals there is no more record ID.
Reader 1 has no chance to check record 2 and 4, while reader 2 has no
chance to check record 1 and 3. And any other GET_NEXT_RECORD_ID will
return -1, that is, other readers will has no chance to check any
record even they are not cleared by anyone.
This makes raw GET_NEXT_RECORD_ID not suitable for used by multiple
users.
To solve the issue, an in-memory ERST record ID cache is designed and
implemented. When enumerating record ID, the ID returned by
GET_NEXT_RECORD_ID is added into cache in addition to be returned to
caller. So other readers can check the cache to get all record ID
available.
Signed-off-by: Huang Ying <ying.huang@intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/acpi')
-rw-r--r-- | include/acpi/apei.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/acpi/apei.h b/include/acpi/apei.h index c4dbb132d902..e67b523a50e1 100644 --- a/include/acpi/apei.h +++ b/include/acpi/apei.h @@ -30,10 +30,11 @@ int apei_hest_parse(apei_hest_func_t func, void *data); int erst_write(const struct cper_record_header *record); ssize_t erst_get_record_count(void); -int erst_get_next_record_id(u64 *record_id); +int erst_get_record_id_begin(int *pos); +int erst_get_record_id_next(int *pos, u64 *record_id); +void erst_get_record_id_end(void); ssize_t erst_read(u64 record_id, struct cper_record_header *record, size_t buflen); -ssize_t erst_read_next(struct cper_record_header *record, size_t buflen); int erst_clear(u64 record_id); #endif |