Skip to content

Commit 510610f

Browse files
committed
parisc: BTLB: Add BTLB insert and purge firmware function wrappers
Signed-off-by: Helge Deller <deller@gmx.de>
1 parent eda2052 commit 510610f

File tree

2 files changed

+36
-9
lines changed

2 files changed

+36
-9
lines changed

arch/parisc/include/asm/pdc.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ int pdc_cache_info(struct pdc_cache_info *cache);
4646
int pdc_spaceid_bits(unsigned long *space_bits);
4747
#ifndef CONFIG_PA20
4848
int pdc_btlb_info(struct pdc_btlb_info *btlb);
49+
int pdc_btlb_insert(unsigned long long vpage, unsigned long physpage, unsigned long len,
50+
unsigned long entry_info, unsigned long slot);
51+
int pdc_btlb_purge_all(void);
4952
int pdc_mem_map_hpa(struct pdc_memory_map *r_addr, struct pdc_module_path *mod_path);
5053
#endif /* !CONFIG_PA20 */
5154
int pdc_pim_toc11(struct pdc_toc_pim_11 *ret);

arch/parisc/kernel/firmware.c

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -696,18 +696,42 @@ int pdc_spaceid_bits(unsigned long *space_bits)
696696
*/
697697
int pdc_btlb_info(struct pdc_btlb_info *btlb)
698698
{
699-
int retval;
699+
int retval;
700700
unsigned long flags;
701701

702-
spin_lock_irqsave(&pdc_lock, flags);
703-
retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_INFO, __pa(pdc_result), 0);
704-
memcpy(btlb, pdc_result, sizeof(*btlb));
705-
spin_unlock_irqrestore(&pdc_lock, flags);
702+
spin_lock_irqsave(&pdc_lock, flags);
703+
retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_INFO, __pa(pdc_result), 0);
704+
memcpy(btlb, pdc_result, sizeof(*btlb));
705+
spin_unlock_irqrestore(&pdc_lock, flags);
706706

707-
if(retval < 0) {
708-
btlb->max_size = 0;
709-
}
710-
return retval;
707+
if(retval < 0) {
708+
btlb->max_size = 0;
709+
}
710+
return retval;
711+
}
712+
713+
int pdc_btlb_insert(unsigned long long vpage, unsigned long physpage, unsigned long len,
714+
unsigned long entry_info, unsigned long slot)
715+
{
716+
int retval;
717+
unsigned long flags;
718+
719+
spin_lock_irqsave(&pdc_lock, flags);
720+
retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_INSERT, (unsigned long) (vpage >> 32),
721+
(unsigned long) vpage, physpage, len, entry_info, slot);
722+
spin_unlock_irqrestore(&pdc_lock, flags);
723+
return retval;
724+
}
725+
726+
int pdc_btlb_purge_all(void)
727+
{
728+
int retval;
729+
unsigned long flags;
730+
731+
spin_lock_irqsave(&pdc_lock, flags);
732+
retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_PURGE_ALL);
733+
spin_unlock_irqrestore(&pdc_lock, flags);
734+
return retval;
711735
}
712736

713737
/**

0 commit comments

Comments
 (0)