diff options
author | Bryan Thompson <bryan.thompson@unisys.com> | 2016-12-01 01:31:05 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-12-01 03:58:48 -0500 |
commit | c7e047768b8cac22398b0dc5e572e3482f07006b (patch) | |
tree | f3b16e0b8eb6643d9cd84821bd70a93090fa5ef2 | |
parent | 22744c96c7a4c41e6fd60058b165965d58b24cbc (diff) |
staging: unisys: visorbus: Replace two base postcode macros with one
Leverage the 3 existing s-Par postcode macros to do a bit more work
and provide only 1 base postcode macro.
Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/unisys/visorbus/vmcallinterface.h | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/staging/unisys/visorbus/vmcallinterface.h b/drivers/staging/unisys/visorbus/vmcallinterface.h index a8f6f6ca7662..ab44402ca422 100644 --- a/drivers/staging/unisys/visorbus/vmcallinterface.h +++ b/drivers/staging/unisys/visorbus/vmcallinterface.h | |||
@@ -227,7 +227,13 @@ enum event_pc { /* POSTCODE event identifier tuples */ | |||
227 | /* TODO-> Info currently doesn't show, so we set info=warning */ | 227 | /* TODO-> Info currently doesn't show, so we set info=warning */ |
228 | #define POSTCODE_SEVERITY_INFO DIAG_SEVERITY_PRINT | 228 | #define POSTCODE_SEVERITY_INFO DIAG_SEVERITY_PRINT |
229 | 229 | ||
230 | /* example call of POSTCODE_LINUX_2(VISOR_CHIPSET_PC, POSTCODE_SEVERITY_ERR); | 230 | /* Write a 64-bit value to the hypervisor's log file |
231 | * POSTCODE_LINUX generates a value in the form 0xAABBBCCCDDDDEEEE where | ||
232 | * A is an identifier for the file logging the postcode | ||
233 | * B is an identifier for the event logging the postcode | ||
234 | * C is the line logging the postcode | ||
235 | * D is additional information the caller wants to log | ||
236 | * E is additional information the caller wants to log | ||
231 | * Please also note that the resulting postcode is in hex, so if you are | 237 | * Please also note that the resulting postcode is in hex, so if you are |
232 | * searching for the __LINE__ number, convert it first to decimal. The line | 238 | * searching for the __LINE__ number, convert it first to decimal. The line |
233 | * number combined with driver and type of call, will allow you to track down | 239 | * number combined with driver and type of call, will allow you to track down |
@@ -236,16 +242,7 @@ enum event_pc { /* POSTCODE event identifier tuples */ | |||
236 | */ | 242 | */ |
237 | 243 | ||
238 | /* BASE FUNCTIONS */ | 244 | /* BASE FUNCTIONS */ |
239 | #define POSTCODE_LINUX_A(DRIVER_PC, EVENT_PC, pc32bit, severity) \ | 245 | #define POSTCODE_LINUX(DRIVER_PC, EVENT_PC, pc16bit1, pc16bit2, severity) \ |
240 | do { \ | ||
241 | unsigned long long post_code_temp; \ | ||
242 | post_code_temp = (((u64)DRIVER_PC) << 56) | (((u64)EVENT_PC) << 44) | \ | ||
243 | ((((u64)__LINE__) & 0xFFF) << 32) | \ | ||
244 | (((u64)pc32bit) & 0xFFFFFFFF); \ | ||
245 | ISSUE_IO_VMCALL_POSTCODE_SEVERITY(post_code_temp, severity); \ | ||
246 | } while (0) | ||
247 | |||
248 | #define POSTCODE_LINUX_B(DRIVER_PC, EVENT_PC, pc16bit1, pc16bit2, severity) \ | ||
249 | do { \ | 246 | do { \ |
250 | unsigned long long post_code_temp; \ | 247 | unsigned long long post_code_temp; \ |
251 | post_code_temp = (((u64)DRIVER_PC) << 56) | (((u64)EVENT_PC) << 44) | \ | 248 | post_code_temp = (((u64)DRIVER_PC) << 56) | (((u64)EVENT_PC) << 44) | \ |
@@ -257,13 +254,14 @@ do { \ | |||
257 | 254 | ||
258 | /* MOST COMMON */ | 255 | /* MOST COMMON */ |
259 | #define POSTCODE_LINUX_2(EVENT_PC, severity) \ | 256 | #define POSTCODE_LINUX_2(EVENT_PC, severity) \ |
260 | POSTCODE_LINUX_A(CURRENT_FILE_PC, EVENT_PC, 0x0000, severity) | 257 | POSTCODE_LINUX(CURRENT_FILE_PC, EVENT_PC, 0, 0, severity) |
261 | 258 | ||
262 | #define POSTCODE_LINUX_3(EVENT_PC, pc32bit, severity) \ | 259 | #define POSTCODE_LINUX_3(EVENT_PC, pc32bit, severity) \ |
263 | POSTCODE_LINUX_A(CURRENT_FILE_PC, EVENT_PC, pc32bit, severity) | 260 | POSTCODE_LINUX(CURRENT_FILE_PC, EVENT_PC, (pc32bit >> 16), \ |
261 | (pc32bit & 0xFFFF), severity) | ||
264 | 262 | ||
265 | #define POSTCODE_LINUX_4(EVENT_PC, pc16bit1, pc16bit2, severity) \ | 263 | #define POSTCODE_LINUX_4(EVENT_PC, pc16bit1, pc16bit2, severity) \ |
266 | POSTCODE_LINUX_B(CURRENT_FILE_PC, EVENT_PC, pc16bit1, \ | 264 | POSTCODE_LINUX(CURRENT_FILE_PC, EVENT_PC, pc16bit1, \ |
267 | pc16bit2, severity) | 265 | pc16bit2, severity) |
268 | 266 | ||
269 | #endif /* __IOMONINTF_H__ */ | 267 | #endif /* __IOMONINTF_H__ */ |