Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

parisc: Add wrapper for pdc_instr() firmware function

Signed-off-by: Helge Deller <deller@gmx.de>

+21
+1
arch/parisc/include/asm/pdc.h
··· 280 280 /* wrapper-functions from pdc.c */ 281 281 282 282 int pdc_add_valid(unsigned long address); 283 + int pdc_instr(unsigned int *instr); 283 284 int pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_info, unsigned long len); 284 285 int pdc_chassis_disp(unsigned long disp); 285 286 int pdc_chassis_warn(unsigned long *warn);
+20
arch/parisc/kernel/firmware.c
··· 233 233 EXPORT_SYMBOL(pdc_add_valid); 234 234 235 235 /** 236 + * pdc_instr - Get instruction that invokes PDCE_CHECK in HPMC handler. 237 + * @instr: Pointer to variable which will get instruction opcode. 238 + * 239 + * The return value is PDC_OK (0) in case call succeeded. 240 + */ 241 + int __init pdc_instr(unsigned int *instr) 242 + { 243 + int retval; 244 + unsigned long flags; 245 + 246 + spin_lock_irqsave(&pdc_lock, flags); 247 + retval = mem_pdc_call(PDC_INSTR, 0UL, __pa(pdc_result)); 248 + convert_to_wide(pdc_result); 249 + *instr = pdc_result[0]; 250 + spin_unlock_irqrestore(&pdc_lock, flags); 251 + 252 + return retval; 253 + } 254 + 255 + /** 236 256 * pdc_chassis_info - Return chassis information. 237 257 * @result: The return buffer. 238 258 * @chassis_info: The memory buffer address.