2008-01-29 04:05:38 +08:00
|
|
|
/*
|
|
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
|
|
* for more details.
|
|
|
|
*
|
|
|
|
* A small micro-assembler. It is intentionally kept simple, does only
|
|
|
|
* support a subset of instructions, and does not try to hide pipeline
|
|
|
|
* effects like branch delay slots.
|
|
|
|
*
|
2013-01-22 19:59:30 +08:00
|
|
|
* Copyright (C) 2004, 2005, 2006, 2008 Thiemo Seufer
|
2008-01-29 04:05:38 +08:00
|
|
|
* Copyright (C) 2005, 2007 Maciej W. Rozycki
|
|
|
|
* Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org)
|
2013-02-06 06:52:01 +08:00
|
|
|
* Copyright (C) 2012, 2013 MIPS Technologies, Inc. All rights reserved.
|
2008-01-29 04:05:38 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
enum fields {
|
|
|
|
RS = 0x001,
|
|
|
|
RT = 0x002,
|
|
|
|
RD = 0x004,
|
|
|
|
RE = 0x008,
|
|
|
|
SIMM = 0x010,
|
|
|
|
UIMM = 0x020,
|
|
|
|
BIMM = 0x040,
|
|
|
|
JIMM = 0x080,
|
|
|
|
FUNC = 0x100,
|
2010-02-19 08:13:03 +08:00
|
|
|
SET = 0x200,
|
|
|
|
SCIMM = 0x400
|
2008-01-29 04:05:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#define OP_MASK 0x3f
|
|
|
|
#define OP_SH 26
|
|
|
|
#define RD_MASK 0x1f
|
|
|
|
#define RD_SH 11
|
|
|
|
#define RE_MASK 0x1f
|
|
|
|
#define RE_SH 6
|
|
|
|
#define IMM_MASK 0xffff
|
|
|
|
#define IMM_SH 0
|
|
|
|
#define JIMM_MASK 0x3ffffff
|
|
|
|
#define JIMM_SH 0
|
|
|
|
#define FUNC_MASK 0x3f
|
|
|
|
#define FUNC_SH 0
|
|
|
|
#define SET_MASK 0x7
|
|
|
|
#define SET_SH 0
|
|
|
|
|
|
|
|
enum opcode {
|
|
|
|
insn_invalid,
|
2012-06-20 02:59:29 +08:00
|
|
|
insn_addiu, insn_addu, insn_and, insn_andi, insn_bbit0, insn_bbit1,
|
|
|
|
insn_beq, insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl,
|
|
|
|
insn_bne, insn_cache, insn_daddiu, insn_daddu, insn_dins, insn_dinsm,
|
|
|
|
insn_dmfc0, insn_dmtc0, insn_drotr, insn_drotr32, insn_dsll,
|
|
|
|
insn_dsll32, insn_dsra, insn_dsrl, insn_dsrl32, insn_dsubu, insn_eret,
|
2012-07-13 01:21:31 +08:00
|
|
|
insn_ext, insn_ins, insn_j, insn_jal, insn_jr, insn_ld, insn_ldx,
|
|
|
|
insn_ll, insn_lld, insn_lui, insn_lw, insn_lwx, insn_mfc0, insn_mtc0,
|
|
|
|
insn_or, insn_ori, insn_pref, insn_rfe, insn_rotr, insn_sc, insn_scd,
|
|
|
|
insn_sd, insn_sll, insn_sra, insn_srl, insn_subu, insn_sw,
|
|
|
|
insn_syscall, insn_tlbp, insn_tlbr, insn_tlbwi, insn_tlbwr, insn_xor,
|
|
|
|
insn_xori,
|
2008-01-29 04:05:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct insn {
|
|
|
|
enum opcode opcode;
|
|
|
|
u32 match;
|
|
|
|
enum fields fields;
|
|
|
|
};
|
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
static inline u32 build_rs(u32 arg)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
2010-12-28 10:18:29 +08:00
|
|
|
WARN(arg & ~RS_MASK, KERN_WARNING "Micro-assembler field overflow\n");
|
2008-01-29 04:05:38 +08:00
|
|
|
|
|
|
|
return (arg & RS_MASK) << RS_SH;
|
|
|
|
}
|
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
static inline u32 build_rt(u32 arg)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
2010-12-28 10:18:29 +08:00
|
|
|
WARN(arg & ~RT_MASK, KERN_WARNING "Micro-assembler field overflow\n");
|
2008-01-29 04:05:38 +08:00
|
|
|
|
|
|
|
return (arg & RT_MASK) << RT_SH;
|
|
|
|
}
|
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
static inline u32 build_rd(u32 arg)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
2010-12-28 10:18:29 +08:00
|
|
|
WARN(arg & ~RD_MASK, KERN_WARNING "Micro-assembler field overflow\n");
|
2008-01-29 04:05:38 +08:00
|
|
|
|
|
|
|
return (arg & RD_MASK) << RD_SH;
|
|
|
|
}
|
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
static inline u32 build_re(u32 arg)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
2010-12-28 10:18:29 +08:00
|
|
|
WARN(arg & ~RE_MASK, KERN_WARNING "Micro-assembler field overflow\n");
|
2008-01-29 04:05:38 +08:00
|
|
|
|
|
|
|
return (arg & RE_MASK) << RE_SH;
|
|
|
|
}
|
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
static inline u32 build_simm(s32 arg)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
2010-12-28 10:18:29 +08:00
|
|
|
WARN(arg > 0x7fff || arg < -0x8000,
|
|
|
|
KERN_WARNING "Micro-assembler field overflow\n");
|
2008-01-29 04:05:38 +08:00
|
|
|
|
|
|
|
return arg & 0xffff;
|
|
|
|
}
|
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
static inline u32 build_uimm(u32 arg)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
2010-12-28 10:18:29 +08:00
|
|
|
WARN(arg & ~IMM_MASK, KERN_WARNING "Micro-assembler field overflow\n");
|
2008-01-29 04:05:38 +08:00
|
|
|
|
|
|
|
return arg & IMM_MASK;
|
|
|
|
}
|
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
static inline u32 build_scimm(u32 arg)
|
2010-02-19 08:13:03 +08:00
|
|
|
{
|
2010-12-28 10:18:29 +08:00
|
|
|
WARN(arg & ~SCIMM_MASK,
|
|
|
|
KERN_WARNING "Micro-assembler field overflow\n");
|
2010-02-19 08:13:03 +08:00
|
|
|
|
|
|
|
return (arg & SCIMM_MASK) << SCIMM_SH;
|
|
|
|
}
|
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
static inline u32 build_func(u32 arg)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
2010-12-28 10:18:29 +08:00
|
|
|
WARN(arg & ~FUNC_MASK, KERN_WARNING "Micro-assembler field overflow\n");
|
2008-01-29 04:05:38 +08:00
|
|
|
|
|
|
|
return arg & FUNC_MASK;
|
|
|
|
}
|
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
static inline u32 build_set(u32 arg)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
2010-12-28 10:18:29 +08:00
|
|
|
WARN(arg & ~SET_MASK, KERN_WARNING "Micro-assembler field overflow\n");
|
2008-01-29 04:05:38 +08:00
|
|
|
|
|
|
|
return arg & SET_MASK;
|
|
|
|
}
|
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
static void build_insn(u32 **buf, enum opcode opc, ...);
|
2008-01-29 04:05:38 +08:00
|
|
|
|
|
|
|
#define I_u1u2u3(op) \
|
|
|
|
Ip_u1u2u3(op) \
|
|
|
|
{ \
|
|
|
|
build_insn(buf, insn##op, a, b, c); \
|
2010-07-24 09:41:43 +08:00
|
|
|
} \
|
|
|
|
UASM_EXPORT_SYMBOL(uasm_i##op);
|
2008-01-29 04:05:38 +08:00
|
|
|
|
|
|
|
#define I_u2u1u3(op) \
|
|
|
|
Ip_u2u1u3(op) \
|
|
|
|
{ \
|
|
|
|
build_insn(buf, insn##op, b, a, c); \
|
2010-07-24 09:41:43 +08:00
|
|
|
} \
|
|
|
|
UASM_EXPORT_SYMBOL(uasm_i##op);
|
2008-01-29 04:05:38 +08:00
|
|
|
|
|
|
|
#define I_u3u1u2(op) \
|
|
|
|
Ip_u3u1u2(op) \
|
|
|
|
{ \
|
|
|
|
build_insn(buf, insn##op, b, c, a); \
|
2010-07-24 09:41:43 +08:00
|
|
|
} \
|
|
|
|
UASM_EXPORT_SYMBOL(uasm_i##op);
|
2008-01-29 04:05:38 +08:00
|
|
|
|
|
|
|
#define I_u1u2s3(op) \
|
|
|
|
Ip_u1u2s3(op) \
|
|
|
|
{ \
|
|
|
|
build_insn(buf, insn##op, a, b, c); \
|
2010-07-24 09:41:43 +08:00
|
|
|
} \
|
|
|
|
UASM_EXPORT_SYMBOL(uasm_i##op);
|
2008-01-29 04:05:38 +08:00
|
|
|
|
|
|
|
#define I_u2s3u1(op) \
|
|
|
|
Ip_u2s3u1(op) \
|
|
|
|
{ \
|
|
|
|
build_insn(buf, insn##op, c, a, b); \
|
2010-07-24 09:41:43 +08:00
|
|
|
} \
|
|
|
|
UASM_EXPORT_SYMBOL(uasm_i##op);
|
2008-01-29 04:05:38 +08:00
|
|
|
|
|
|
|
#define I_u2u1s3(op) \
|
|
|
|
Ip_u2u1s3(op) \
|
|
|
|
{ \
|
|
|
|
build_insn(buf, insn##op, b, a, c); \
|
2010-07-24 09:41:43 +08:00
|
|
|
} \
|
|
|
|
UASM_EXPORT_SYMBOL(uasm_i##op);
|
2008-01-29 04:05:38 +08:00
|
|
|
|
2009-10-15 03:16:55 +08:00
|
|
|
#define I_u2u1msbu3(op) \
|
|
|
|
Ip_u2u1msbu3(op) \
|
|
|
|
{ \
|
|
|
|
build_insn(buf, insn##op, b, a, c+d-1, c); \
|
2010-07-24 09:41:43 +08:00
|
|
|
} \
|
|
|
|
UASM_EXPORT_SYMBOL(uasm_i##op);
|
2009-10-15 03:16:55 +08:00
|
|
|
|
2010-12-22 06:19:10 +08:00
|
|
|
#define I_u2u1msb32u3(op) \
|
|
|
|
Ip_u2u1msbu3(op) \
|
|
|
|
{ \
|
|
|
|
build_insn(buf, insn##op, b, a, c+d-33, c); \
|
|
|
|
} \
|
|
|
|
UASM_EXPORT_SYMBOL(uasm_i##op);
|
|
|
|
|
2013-01-22 19:59:30 +08:00
|
|
|
#define I_u2u1msbdu3(op) \
|
2012-07-13 01:21:31 +08:00
|
|
|
Ip_u2u1msbu3(op) \
|
|
|
|
{ \
|
|
|
|
build_insn(buf, insn##op, b, a, d-1, c); \
|
|
|
|
} \
|
|
|
|
UASM_EXPORT_SYMBOL(uasm_i##op);
|
|
|
|
|
2008-01-29 04:05:38 +08:00
|
|
|
#define I_u1u2(op) \
|
|
|
|
Ip_u1u2(op) \
|
|
|
|
{ \
|
|
|
|
build_insn(buf, insn##op, a, b); \
|
2010-07-24 09:41:43 +08:00
|
|
|
} \
|
|
|
|
UASM_EXPORT_SYMBOL(uasm_i##op);
|
2008-01-29 04:05:38 +08:00
|
|
|
|
|
|
|
#define I_u1s2(op) \
|
|
|
|
Ip_u1s2(op) \
|
|
|
|
{ \
|
|
|
|
build_insn(buf, insn##op, a, b); \
|
2010-07-24 09:41:43 +08:00
|
|
|
} \
|
|
|
|
UASM_EXPORT_SYMBOL(uasm_i##op);
|
2008-01-29 04:05:38 +08:00
|
|
|
|
|
|
|
#define I_u1(op) \
|
|
|
|
Ip_u1(op) \
|
|
|
|
{ \
|
|
|
|
build_insn(buf, insn##op, a); \
|
2010-07-24 09:41:43 +08:00
|
|
|
} \
|
|
|
|
UASM_EXPORT_SYMBOL(uasm_i##op);
|
2008-01-29 04:05:38 +08:00
|
|
|
|
|
|
|
#define I_0(op) \
|
|
|
|
Ip_0(op) \
|
|
|
|
{ \
|
|
|
|
build_insn(buf, insn##op); \
|
2010-07-24 09:41:43 +08:00
|
|
|
} \
|
|
|
|
UASM_EXPORT_SYMBOL(uasm_i##op);
|
2008-01-29 04:05:38 +08:00
|
|
|
|
|
|
|
I_u2u1s3(_addiu)
|
|
|
|
I_u3u1u2(_addu)
|
|
|
|
I_u2u1u3(_andi)
|
|
|
|
I_u3u1u2(_and)
|
|
|
|
I_u1u2s3(_beq)
|
|
|
|
I_u1u2s3(_beql)
|
|
|
|
I_u1s2(_bgez)
|
|
|
|
I_u1s2(_bgezl)
|
|
|
|
I_u1s2(_bltz)
|
|
|
|
I_u1s2(_bltzl)
|
|
|
|
I_u1u2s3(_bne)
|
2008-02-19 03:32:49 +08:00
|
|
|
I_u2s3u1(_cache)
|
2008-01-29 04:05:38 +08:00
|
|
|
I_u1u2u3(_dmfc0)
|
|
|
|
I_u1u2u3(_dmtc0)
|
|
|
|
I_u2u1s3(_daddiu)
|
|
|
|
I_u3u1u2(_daddu)
|
|
|
|
I_u2u1u3(_dsll)
|
|
|
|
I_u2u1u3(_dsll32)
|
|
|
|
I_u2u1u3(_dsra)
|
|
|
|
I_u2u1u3(_dsrl)
|
|
|
|
I_u2u1u3(_dsrl32)
|
2009-10-15 03:16:55 +08:00
|
|
|
I_u2u1u3(_drotr)
|
2010-07-24 09:41:41 +08:00
|
|
|
I_u2u1u3(_drotr32)
|
2008-01-29 04:05:38 +08:00
|
|
|
I_u3u1u2(_dsubu)
|
|
|
|
I_0(_eret)
|
2012-07-13 01:21:31 +08:00
|
|
|
I_u2u1msbdu3(_ext)
|
|
|
|
I_u2u1msbu3(_ins)
|
2008-01-29 04:05:38 +08:00
|
|
|
I_u1(_j)
|
|
|
|
I_u1(_jal)
|
|
|
|
I_u1(_jr)
|
|
|
|
I_u2s3u1(_ld)
|
|
|
|
I_u2s3u1(_ll)
|
|
|
|
I_u2s3u1(_lld)
|
|
|
|
I_u1s2(_lui)
|
|
|
|
I_u2s3u1(_lw)
|
|
|
|
I_u1u2u3(_mfc0)
|
|
|
|
I_u1u2u3(_mtc0)
|
|
|
|
I_u2u1u3(_ori)
|
2010-03-23 22:54:50 +08:00
|
|
|
I_u3u1u2(_or)
|
2008-01-29 04:05:38 +08:00
|
|
|
I_0(_rfe)
|
|
|
|
I_u2s3u1(_sc)
|
|
|
|
I_u2s3u1(_scd)
|
|
|
|
I_u2s3u1(_sd)
|
|
|
|
I_u2u1u3(_sll)
|
|
|
|
I_u2u1u3(_sra)
|
|
|
|
I_u2u1u3(_srl)
|
2010-02-11 07:12:46 +08:00
|
|
|
I_u2u1u3(_rotr)
|
2008-01-29 04:05:38 +08:00
|
|
|
I_u3u1u2(_subu)
|
|
|
|
I_u2s3u1(_sw)
|
|
|
|
I_0(_tlbp)
|
2010-02-11 07:12:46 +08:00
|
|
|
I_0(_tlbr)
|
2008-01-29 04:05:38 +08:00
|
|
|
I_0(_tlbwi)
|
|
|
|
I_0(_tlbwr)
|
|
|
|
I_u3u1u2(_xor)
|
|
|
|
I_u2u1u3(_xori)
|
2009-10-15 03:16:55 +08:00
|
|
|
I_u2u1msbu3(_dins);
|
2010-12-22 06:19:10 +08:00
|
|
|
I_u2u1msb32u3(_dinsm);
|
2010-02-19 08:13:03 +08:00
|
|
|
I_u1(_syscall);
|
2010-07-24 09:41:42 +08:00
|
|
|
I_u1u2s3(_bbit0);
|
|
|
|
I_u1u2s3(_bbit1);
|
2010-12-28 10:07:56 +08:00
|
|
|
I_u3u1u2(_lwx)
|
|
|
|
I_u3u1u2(_ldx)
|
2008-01-29 04:05:38 +08:00
|
|
|
|
2010-10-08 07:03:53 +08:00
|
|
|
#ifdef CONFIG_CPU_CAVIUM_OCTEON
|
|
|
|
#include <asm/octeon/octeon.h>
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
void ISAFUNC(uasm_i_pref)(u32 **buf, unsigned int a, signed int b,
|
2010-10-08 07:03:53 +08:00
|
|
|
unsigned int c)
|
|
|
|
{
|
|
|
|
if (OCTEON_IS_MODEL(OCTEON_CN63XX_PASS1_X) && a <= 24 && a != 5)
|
|
|
|
/*
|
|
|
|
* As per erratum Core-14449, replace prefetches 0-4,
|
|
|
|
* 6-24 with 'pref 28'.
|
|
|
|
*/
|
|
|
|
build_insn(buf, insn_pref, c, 28, b);
|
|
|
|
else
|
|
|
|
build_insn(buf, insn_pref, c, a, b);
|
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_i_pref));
|
2010-10-08 07:03:53 +08:00
|
|
|
#else
|
|
|
|
I_u2s3u1(_pref)
|
|
|
|
#endif
|
|
|
|
|
2008-01-29 04:05:38 +08:00
|
|
|
/* Handle labels. */
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
void ISAFUNC(uasm_build_label)(struct uasm_label **lab, u32 *addr, int lid)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
|
|
|
(*lab)->addr = addr;
|
|
|
|
(*lab)->lab = lid;
|
|
|
|
(*lab)++;
|
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_build_label));
|
2008-01-29 04:05:38 +08:00
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
int ISAFUNC(uasm_in_compat_space_p)(long addr)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
|
|
|
/* Is this address in 32bit compat space? */
|
|
|
|
#ifdef CONFIG_64BIT
|
|
|
|
return (((addr) & 0xffffffff00000000L) == 0xffffffff00000000L);
|
|
|
|
#else
|
|
|
|
return 1;
|
|
|
|
#endif
|
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_in_compat_space_p));
|
2008-01-29 04:05:38 +08:00
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
static int uasm_rel_highest(long val)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
|
|
|
#ifdef CONFIG_64BIT
|
|
|
|
return ((((val + 0x800080008000L) >> 48) & 0xffff) ^ 0x8000) - 0x8000;
|
|
|
|
#else
|
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
static int uasm_rel_higher(long val)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
|
|
|
#ifdef CONFIG_64BIT
|
|
|
|
return ((((val + 0x80008000L) >> 32) & 0xffff) ^ 0x8000) - 0x8000;
|
|
|
|
#else
|
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
int ISAFUNC(uasm_rel_hi)(long val)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
|
|
|
return ((((val + 0x8000L) >> 16) & 0xffff) ^ 0x8000) - 0x8000;
|
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_rel_hi));
|
2008-01-29 04:05:38 +08:00
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
int ISAFUNC(uasm_rel_lo)(long val)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
|
|
|
return ((val & 0xffff) ^ 0x8000) - 0x8000;
|
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_rel_lo));
|
2008-01-29 04:05:38 +08:00
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
void ISAFUNC(UASM_i_LA_mostly)(u32 **buf, unsigned int rs, long addr)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
2013-02-06 06:52:01 +08:00
|
|
|
if (!ISAFUNC(uasm_in_compat_space_p)(addr)) {
|
|
|
|
ISAFUNC(uasm_i_lui)(buf, rs, uasm_rel_highest(addr));
|
2008-01-29 04:05:38 +08:00
|
|
|
if (uasm_rel_higher(addr))
|
2013-02-06 06:52:01 +08:00
|
|
|
ISAFUNC(uasm_i_daddiu)(buf, rs, rs, uasm_rel_higher(addr));
|
|
|
|
if (ISAFUNC(uasm_rel_hi(addr))) {
|
|
|
|
ISAFUNC(uasm_i_dsll)(buf, rs, rs, 16);
|
|
|
|
ISAFUNC(uasm_i_daddiu)(buf, rs, rs,
|
|
|
|
ISAFUNC(uasm_rel_hi)(addr));
|
|
|
|
ISAFUNC(uasm_i_dsll)(buf, rs, rs, 16);
|
2008-01-29 04:05:38 +08:00
|
|
|
} else
|
2013-02-06 06:52:01 +08:00
|
|
|
ISAFUNC(uasm_i_dsll32)(buf, rs, rs, 0);
|
2008-01-29 04:05:38 +08:00
|
|
|
} else
|
2013-02-06 06:52:01 +08:00
|
|
|
ISAFUNC(uasm_i_lui)(buf, rs, ISAFUNC(uasm_rel_hi(addr)));
|
2008-01-29 04:05:38 +08:00
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(UASM_i_LA_mostly));
|
2008-01-29 04:05:38 +08:00
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
void ISAFUNC(UASM_i_LA)(u32 **buf, unsigned int rs, long addr)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
2013-02-06 06:52:01 +08:00
|
|
|
ISAFUNC(UASM_i_LA_mostly)(buf, rs, addr);
|
|
|
|
if (ISAFUNC(uasm_rel_lo(addr))) {
|
|
|
|
if (!ISAFUNC(uasm_in_compat_space_p)(addr))
|
|
|
|
ISAFUNC(uasm_i_daddiu)(buf, rs, rs,
|
|
|
|
ISAFUNC(uasm_rel_lo(addr)));
|
2008-01-29 04:05:38 +08:00
|
|
|
else
|
2013-02-06 06:52:01 +08:00
|
|
|
ISAFUNC(uasm_i_addiu)(buf, rs, rs,
|
|
|
|
ISAFUNC(uasm_rel_lo(addr)));
|
2008-01-29 04:05:38 +08:00
|
|
|
}
|
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(UASM_i_LA));
|
2008-01-29 04:05:38 +08:00
|
|
|
|
|
|
|
/* Handle relocations. */
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
void ISAFUNC(uasm_r_mips_pc16)(struct uasm_reloc **rel, u32 *addr, int lid)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
|
|
|
(*rel)->addr = addr;
|
|
|
|
(*rel)->type = R_MIPS_PC16;
|
|
|
|
(*rel)->lab = lid;
|
|
|
|
(*rel)++;
|
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_r_mips_pc16));
|
2008-01-29 04:05:38 +08:00
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
static inline void __resolve_relocs(struct uasm_reloc *rel,
|
|
|
|
struct uasm_label *lab);
|
2008-01-29 04:05:38 +08:00
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
void ISAFUNC(uasm_resolve_relocs)(struct uasm_reloc *rel,
|
|
|
|
struct uasm_label *lab)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
|
|
|
struct uasm_label *l;
|
|
|
|
|
|
|
|
for (; rel->lab != UASM_LABEL_INVALID; rel++)
|
|
|
|
for (l = lab; l->lab != UASM_LABEL_INVALID; l++)
|
|
|
|
if (rel->lab == l->lab)
|
|
|
|
__resolve_relocs(rel, l);
|
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_resolve_relocs));
|
2008-01-29 04:05:38 +08:00
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
void ISAFUNC(uasm_move_relocs)(struct uasm_reloc *rel, u32 *first, u32 *end,
|
|
|
|
long off)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
|
|
|
for (; rel->lab != UASM_LABEL_INVALID; rel++)
|
|
|
|
if (rel->addr >= first && rel->addr < end)
|
|
|
|
rel->addr += off;
|
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_move_relocs));
|
2008-01-29 04:05:38 +08:00
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
void ISAFUNC(uasm_move_labels)(struct uasm_label *lab, u32 *first, u32 *end,
|
|
|
|
long off)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
|
|
|
for (; lab->lab != UASM_LABEL_INVALID; lab++)
|
|
|
|
if (lab->addr >= first && lab->addr < end)
|
|
|
|
lab->addr += off;
|
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_move_labels));
|
2008-01-29 04:05:38 +08:00
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
void ISAFUNC(uasm_copy_handler)(struct uasm_reloc *rel, struct uasm_label *lab,
|
|
|
|
u32 *first, u32 *end, u32 *target)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
|
|
|
long off = (long)(target - first);
|
|
|
|
|
|
|
|
memcpy(target, first, (end - first) * sizeof(u32));
|
|
|
|
|
2013-02-06 06:52:01 +08:00
|
|
|
ISAFUNC(uasm_move_relocs(rel, first, end, off));
|
|
|
|
ISAFUNC(uasm_move_labels(lab, first, end, off));
|
2008-01-29 04:05:38 +08:00
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_copy_handler));
|
2008-01-29 04:05:38 +08:00
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
int ISAFUNC(uasm_insn_has_bdelay)(struct uasm_reloc *rel, u32 *addr)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
|
|
|
for (; rel->lab != UASM_LABEL_INVALID; rel++) {
|
|
|
|
if (rel->addr == addr
|
|
|
|
&& (rel->type == R_MIPS_PC16
|
|
|
|
|| rel->type == R_MIPS_26))
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_insn_has_bdelay));
|
2008-01-29 04:05:38 +08:00
|
|
|
|
|
|
|
/* Convenience functions for labeled branches. */
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
void ISAFUNC(uasm_il_bltz)(u32 **p, struct uasm_reloc **r, unsigned int reg,
|
|
|
|
int lid)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
|
|
|
uasm_r_mips_pc16(r, *p, lid);
|
2013-02-06 06:52:01 +08:00
|
|
|
ISAFUNC(uasm_i_bltz)(p, reg, 0);
|
2008-01-29 04:05:38 +08:00
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bltz));
|
2008-01-29 04:05:38 +08:00
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
void ISAFUNC(uasm_il_b)(u32 **p, struct uasm_reloc **r, int lid)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
|
|
|
uasm_r_mips_pc16(r, *p, lid);
|
2013-02-06 06:52:01 +08:00
|
|
|
ISAFUNC(uasm_i_b)(p, 0);
|
2008-01-29 04:05:38 +08:00
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_b));
|
2008-01-29 04:05:38 +08:00
|
|
|
|
2013-12-24 11:51:39 +08:00
|
|
|
void ISAFUNC(uasm_il_beq)(u32 **p, struct uasm_reloc **r, unsigned int r1,
|
|
|
|
unsigned int r2, int lid)
|
|
|
|
{
|
|
|
|
uasm_r_mips_pc16(r, *p, lid);
|
|
|
|
ISAFUNC(uasm_i_beq)(p, r1, r2, 0);
|
|
|
|
}
|
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_beq));
|
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
void ISAFUNC(uasm_il_beqz)(u32 **p, struct uasm_reloc **r, unsigned int reg,
|
|
|
|
int lid)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
|
|
|
uasm_r_mips_pc16(r, *p, lid);
|
2013-02-06 06:52:01 +08:00
|
|
|
ISAFUNC(uasm_i_beqz)(p, reg, 0);
|
2008-01-29 04:05:38 +08:00
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_beqz));
|
2008-01-29 04:05:38 +08:00
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
void ISAFUNC(uasm_il_beqzl)(u32 **p, struct uasm_reloc **r, unsigned int reg,
|
|
|
|
int lid)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
|
|
|
uasm_r_mips_pc16(r, *p, lid);
|
2013-02-06 06:52:01 +08:00
|
|
|
ISAFUNC(uasm_i_beqzl)(p, reg, 0);
|
2008-01-29 04:05:38 +08:00
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_beqzl));
|
2008-01-29 04:05:38 +08:00
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
void ISAFUNC(uasm_il_bne)(u32 **p, struct uasm_reloc **r, unsigned int reg1,
|
|
|
|
unsigned int reg2, int lid)
|
2008-02-19 03:32:49 +08:00
|
|
|
{
|
|
|
|
uasm_r_mips_pc16(r, *p, lid);
|
2013-02-06 06:52:01 +08:00
|
|
|
ISAFUNC(uasm_i_bne)(p, reg1, reg2, 0);
|
2008-02-19 03:32:49 +08:00
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bne));
|
2008-02-19 03:32:49 +08:00
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
void ISAFUNC(uasm_il_bnez)(u32 **p, struct uasm_reloc **r, unsigned int reg,
|
|
|
|
int lid)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
|
|
|
uasm_r_mips_pc16(r, *p, lid);
|
2013-02-06 06:52:01 +08:00
|
|
|
ISAFUNC(uasm_i_bnez)(p, reg, 0);
|
2008-01-29 04:05:38 +08:00
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bnez));
|
2008-01-29 04:05:38 +08:00
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
void ISAFUNC(uasm_il_bgezl)(u32 **p, struct uasm_reloc **r, unsigned int reg,
|
|
|
|
int lid)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
|
|
|
uasm_r_mips_pc16(r, *p, lid);
|
2013-02-06 06:52:01 +08:00
|
|
|
ISAFUNC(uasm_i_bgezl)(p, reg, 0);
|
2008-01-29 04:05:38 +08:00
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bgezl));
|
2008-01-29 04:05:38 +08:00
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
void ISAFUNC(uasm_il_bgez)(u32 **p, struct uasm_reloc **r, unsigned int reg,
|
|
|
|
int lid)
|
2008-01-29 04:05:38 +08:00
|
|
|
{
|
|
|
|
uasm_r_mips_pc16(r, *p, lid);
|
2013-02-06 06:52:01 +08:00
|
|
|
ISAFUNC(uasm_i_bgez)(p, reg, 0);
|
2008-01-29 04:05:38 +08:00
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bgez));
|
2010-07-24 09:41:42 +08:00
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
void ISAFUNC(uasm_il_bbit0)(u32 **p, struct uasm_reloc **r, unsigned int reg,
|
|
|
|
unsigned int bit, int lid)
|
2010-07-24 09:41:42 +08:00
|
|
|
{
|
|
|
|
uasm_r_mips_pc16(r, *p, lid);
|
2013-02-06 06:52:01 +08:00
|
|
|
ISAFUNC(uasm_i_bbit0)(p, reg, bit, 0);
|
2010-07-24 09:41:42 +08:00
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bbit0));
|
2010-07-24 09:41:42 +08:00
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 21:38:59 +08:00
|
|
|
void ISAFUNC(uasm_il_bbit1)(u32 **p, struct uasm_reloc **r, unsigned int reg,
|
|
|
|
unsigned int bit, int lid)
|
2010-07-24 09:41:42 +08:00
|
|
|
{
|
|
|
|
uasm_r_mips_pc16(r, *p, lid);
|
2013-02-06 06:52:01 +08:00
|
|
|
ISAFUNC(uasm_i_bbit1)(p, reg, bit, 0);
|
2010-07-24 09:41:42 +08:00
|
|
|
}
|
2013-02-06 06:52:01 +08:00
|
|
|
UASM_EXPORT_SYMBOL(ISAFUNC(uasm_il_bbit1));
|