Commit ededd9d2 authored by Helge Deller's avatar Helge Deller

sticon/parisc: Allow 64-bit STI calls in PDC firmware abstration

Some 64-bit machines require us to call the STI ROM in 64-bit mode, e.g.
with the VisFXe graphic card.
This patch allows drivers to use such 64-bit calling conventions.
Tested-by: default avatarJohn David Anglin <dave.anglin@bell.net>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent c9cc4542
...@@ -88,8 +88,8 @@ int pdc_iodc_print(const unsigned char *str, unsigned count); ...@@ -88,8 +88,8 @@ int pdc_iodc_print(const unsigned char *str, unsigned count);
void pdc_emergency_unlock(void); void pdc_emergency_unlock(void);
int pdc_sti_call(unsigned long func, unsigned long flags, int pdc_sti_call(unsigned long func, unsigned long flags,
unsigned long inptr, unsigned long outputr, unsigned long inptr, unsigned long outputr,
unsigned long glob_cfg); unsigned long glob_cfg, int do_call64);
int __pdc_cpu_rendezvous(void); int __pdc_cpu_rendezvous(void);
void pdc_cpu_rendezvous_lock(void); void pdc_cpu_rendezvous_lock(void);
......
...@@ -1389,17 +1389,25 @@ int pdc_iodc_getc(void) ...@@ -1389,17 +1389,25 @@ int pdc_iodc_getc(void)
} }
int pdc_sti_call(unsigned long func, unsigned long flags, int pdc_sti_call(unsigned long func, unsigned long flags,
unsigned long inptr, unsigned long outputr, unsigned long inptr, unsigned long outputr,
unsigned long glob_cfg) unsigned long glob_cfg, int do_call64)
{ {
int retval; int retval = 0;
unsigned long irqflags; unsigned long irqflags;
spin_lock_irqsave(&pdc_lock, irqflags); spin_lock_irqsave(&pdc_lock, irqflags);
retval = real32_call(func, flags, inptr, outputr, glob_cfg); if (IS_ENABLED(CONFIG_64BIT) && do_call64) {
spin_unlock_irqrestore(&pdc_lock, irqflags); #ifdef CONFIG_64BIT
retval = real64_call(func, flags, inptr, outputr, glob_cfg);
#else
WARN_ON(1);
#endif
} else {
retval = real32_call(func, flags, inptr, outputr, glob_cfg);
}
spin_unlock_irqrestore(&pdc_lock, irqflags);
return retval; return retval;
} }
EXPORT_SYMBOL(pdc_sti_call); EXPORT_SYMBOL(pdc_sti_call);
......
...@@ -1142,7 +1142,7 @@ int sti_call(const struct sti_struct *sti, unsigned long func, ...@@ -1142,7 +1142,7 @@ int sti_call(const struct sti_struct *sti, unsigned long func,
return -1; return -1;
#endif #endif
ret = pdc_sti_call(func, _flags, _inptr, _outptr, _glob_cfg); ret = pdc_sti_call(func, _flags, _inptr, _outptr, _glob_cfg, 0);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment