forked from mchehab/rasdaemon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
non-standard-hisilicon.h
49 lines (41 loc) · 1.25 KB
/
non-standard-hisilicon.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* Copyright (c) 2020 Hisilicon Limited.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*/
#ifndef __NON_STANDARD_HISILICON_H
#define __NON_STANDARD_HISILICON_H
#include "ras-non-standard-handler.h"
#include "ras-mc-handler.h"
#define HISI_SNPRINTF mce_snprintf
#define HISI_ERR_SEVERITY_NFE 0
#define HISI_ERR_SEVERITY_FE 1
#define HISI_ERR_SEVERITY_CE 2
#define HISI_ERR_SEVERITY_NONE 3
enum hisi_oem_data_type {
HISI_OEM_DATA_TYPE_INT,
HISI_OEM_DATA_TYPE_INT64,
HISI_OEM_DATA_TYPE_TEXT,
};
/* helper functions */
static inline char *err_severity(uint8_t err_sev)
{
switch (err_sev) {
case HISI_ERR_SEVERITY_NFE: return "recoverable";
case HISI_ERR_SEVERITY_FE: return "fatal";
case HISI_ERR_SEVERITY_CE: return "corrected";
case HISI_ERR_SEVERITY_NONE: return "none";
default:
break;
}
return "unknown";
}
void record_vendor_data(struct ras_ns_ev_decoder *ev_decoder,
enum hisi_oem_data_type data_type,
int id, int64_t data, const char *text);
int step_vendor_data_tab(struct ras_ns_ev_decoder *ev_decoder, const char *name);
#endif