Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
45 lines
846 B
ArmAsm
45 lines
846 B
ArmAsm
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* "Indirect" DCR access
|
|
*
|
|
* Copyright (c) 2004 Eugene Surovegin <ebs@ebshome.net>
|
|
*/
|
|
|
|
#include <linux/export.h>
|
|
#include <asm/ppc_asm.h>
|
|
#include <asm/processor.h>
|
|
#include <asm/bug.h>
|
|
|
|
#define DCR_ACCESS_PROLOG(table) \
|
|
cmplwi cr0,r3,1024; \
|
|
rlwinm r3,r3,4,18,27; \
|
|
lis r5,table@h; \
|
|
ori r5,r5,table@l; \
|
|
add r3,r3,r5; \
|
|
bge- 1f; \
|
|
mtctr r3; \
|
|
bctr; \
|
|
1: trap; \
|
|
EMIT_BUG_ENTRY 1b,__FILE__,__LINE__,0; \
|
|
blr
|
|
|
|
_GLOBAL(__mfdcr)
|
|
DCR_ACCESS_PROLOG(__mfdcr_table)
|
|
EXPORT_SYMBOL(__mfdcr)
|
|
|
|
_GLOBAL(__mtdcr)
|
|
DCR_ACCESS_PROLOG(__mtdcr_table)
|
|
EXPORT_SYMBOL(__mtdcr)
|
|
|
|
__mfdcr_table:
|
|
mfdcr r3,0; blr
|
|
__mtdcr_table:
|
|
mtdcr 0,r4; blr
|
|
|
|
dcr = 1
|
|
.rept 1023
|
|
mfdcr r3,dcr; blr
|
|
mtdcr dcr,r4; blr
|
|
dcr = dcr + 1
|
|
.endr
|