Interrupt Vector Decode¶
UMR has the ability to decode interrupt vectors (IV) stored in an array of 32-bit words. The decoding is driven by a user interface callback defined as follows:
struct umr_ih_decode_ui {
/** start_vector - Start processing an interrupt vector
*
* ui: The callback structure used
* offset: The offset in dwords of the start of the vector
*/
void (*start_vector)(struct umr_ih_decode_ui *ui, uint32_t offset);
/** add_field - Add a field to the decoding of the interrupt vector
*
* ui: The callback structure used
* offset: The offset in dwords of the field
* field_name: Description of the field
* value: Value (if any) of the field
* str: A string value (if any) for the field
* ideal_radix: The ideal radix to print the value in
*/
void (*add_field)(struct umr_ih_decode_ui *ui, uint32_t offset, const char *field_name, uint32_t value, char *str, int ideal_radix);
/** done: Finish a vector */
void (*done)(struct umr_ih_decode_ui *ui);
/** data -- opaque pointer that can be used to track state information */
void *data;
};
Vectors are decoded with:
int umr_ih_decode_vectors(struct umr_asic *asic, struct umr_ih_decode_ui *ui, uint32_t *ih_data, uint32_t length);
This will decode the the vectors stored in ‘ih_data’ of length ‘length’ bytes (must be a multiple of the natural vector length) for the specific ASIC device ‘asic’.
Returns the number of vectors processed.