Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
ebd99675
Commit
ebd99675
authored
May 14, 2004
by
Andrew Morton
Committed by
Linus Torvalds
May 14, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] H8/300: pic support
From: Yoshinori Sato <ysato@users.sourceforge.jp> - add PIC binary support
parent
e51c5d04
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
10 deletions
+24
-10
arch/h8300/kernel/signal.c
arch/h8300/kernel/signal.c
+4
-0
fs/binfmt_flat.c
fs/binfmt_flat.c
+1
-1
include/asm-h8300/flat.h
include/asm-h8300/flat.h
+2
-1
include/asm-h8300/processor.h
include/asm-h8300/processor.h
+13
-5
include/asm-m68knommu/flat.h
include/asm-m68knommu/flat.h
+1
-1
include/asm-sh/flat.h
include/asm-sh/flat.h
+1
-1
include/asm-v850/flat.h
include/asm-v850/flat.h
+2
-1
No files found.
arch/h8300/kernel/signal.c
View file @
ebd99675
...
@@ -192,6 +192,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *usc, void *fp,
...
@@ -192,6 +192,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *usc, void *fp,
regs
->
er1
=
context
.
sc_er1
;
regs
->
er1
=
context
.
sc_er1
;
regs
->
er2
=
context
.
sc_er2
;
regs
->
er2
=
context
.
sc_er2
;
regs
->
er3
=
context
.
sc_er3
;
regs
->
er3
=
context
.
sc_er3
;
regs
->
er5
=
context
.
sc_er5
;
regs
->
ccr
=
(
regs
->
ccr
&
0x10
)
|
(
context
.
sc_ccr
&
0xef
);
regs
->
ccr
=
(
regs
->
ccr
&
0x10
)
|
(
context
.
sc_ccr
&
0xef
);
regs
->
pc
=
context
.
sc_pc
;
regs
->
pc
=
context
.
sc_pc
;
regs
->
orig_er0
=
-
1
;
/* disable syscall checks */
regs
->
orig_er0
=
-
1
;
/* disable syscall checks */
...
@@ -308,6 +309,7 @@ static void setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
...
@@ -308,6 +309,7 @@ static void setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
sc
->
sc_er1
=
regs
->
er1
;
sc
->
sc_er1
=
regs
->
er1
;
sc
->
sc_er2
=
regs
->
er2
;
sc
->
sc_er2
=
regs
->
er2
;
sc
->
sc_er3
=
regs
->
er3
;
sc
->
sc_er3
=
regs
->
er3
;
sc
->
sc_er5
=
regs
->
er5
;
sc
->
sc_ccr
=
regs
->
ccr
;
sc
->
sc_ccr
=
regs
->
ccr
;
sc
->
sc_pc
=
regs
->
pc
;
sc
->
sc_pc
=
regs
->
pc
;
}
}
...
@@ -384,6 +386,7 @@ static void setup_frame (int sig, struct k_sigaction *ka,
...
@@ -384,6 +386,7 @@ static void setup_frame (int sig, struct k_sigaction *ka,
?
current_thread_info
()
->
exec_domain
->
signal_invmap
[
sig
]
?
current_thread_info
()
->
exec_domain
->
signal_invmap
[
sig
]
:
sig
);
:
sig
);
regs
->
er1
=
(
unsigned
long
)
&
(
frame
->
sc
);
regs
->
er1
=
(
unsigned
long
)
&
(
frame
->
sc
);
regs
->
er5
=
current
->
mm
->
start_data
;
/* GOT base */
return
;
return
;
...
@@ -435,6 +438,7 @@ static void setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info,
...
@@ -435,6 +438,7 @@ static void setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info,
:
sig
);
:
sig
);
regs
->
er1
=
(
unsigned
long
)
&
(
frame
->
info
);
regs
->
er1
=
(
unsigned
long
)
&
(
frame
->
info
);
regs
->
er2
=
(
unsigned
long
)
&
frame
->
uc
;
regs
->
er2
=
(
unsigned
long
)
&
frame
->
uc
;
regs
->
er5
=
current
->
mm
->
start_data
;
/* GOT base */
return
;
return
;
...
...
fs/binfmt_flat.c
View file @
ebd99675
...
@@ -723,7 +723,7 @@ static int load_flat_file(struct linux_binprm * bprm,
...
@@ -723,7 +723,7 @@ static int load_flat_file(struct linux_binprm * bprm,
return
-
ENOEXEC
;
return
-
ENOEXEC
;
/* Get the pointer's value. */
/* Get the pointer's value. */
addr
=
flat_get_addr_from_rp
(
rp
,
relval
);
addr
=
flat_get_addr_from_rp
(
rp
,
relval
,
flags
);
if
(
addr
!=
0
)
{
if
(
addr
!=
0
)
{
/*
/*
* Do the relocation. PIC relocs in the data section are
* Do the relocation. PIC relocs in the data section are
...
...
include/asm-h8300/flat.h
View file @
ebd99675
...
@@ -18,7 +18,8 @@
...
@@ -18,7 +18,8 @@
*/
*/
#define flat_get_relocate_addr(rel) (rel)
#define flat_get_relocate_addr(rel) (rel)
#define flat_get_addr_from_rp(rp, relval) (get_unaligned(rp) & 0x0ffffff)
#define flat_get_addr_from_rp(rp, relval, flags) \
(get_unaligned(rp) & ((flags & FLAT_FLAG_GOTPIC) ? 0xffffffff: 0x00ffffff))
#define flat_put_addr_at_rp(rp, addr, rel) \
#define flat_put_addr_at_rp(rp, addr, rel) \
put_unaligned (((*(char *)(rp)) << 24) | ((addr) & 0x00ffffff), rp)
put_unaligned (((*(char *)(rp)) << 24) | ((addr) & 0x00ffffff), rp)
...
...
include/asm-h8300/processor.h
View file @
ebd99675
...
@@ -23,12 +23,12 @@
...
@@ -23,12 +23,12 @@
#include <asm/ptrace.h>
#include <asm/ptrace.h>
#include <asm/current.h>
#include <asm/current.h>
extern
inline
unsigned
long
rdusp
(
void
)
{
static
inline
unsigned
long
rdusp
(
void
)
{
extern
unsigned
int
sw_usp
;
extern
unsigned
int
sw_usp
;
return
(
sw_usp
);
return
(
sw_usp
);
}
}
extern
inline
void
wrusp
(
unsigned
long
usp
)
{
static
inline
void
wrusp
(
unsigned
long
usp
)
{
extern
unsigned
int
sw_usp
;
extern
unsigned
int
sw_usp
;
sw_usp
=
usp
;
sw_usp
=
usp
;
}
}
...
@@ -62,8 +62,14 @@ struct thread_struct {
...
@@ -62,8 +62,14 @@ struct thread_struct {
};
};
#define INIT_THREAD { \
#define INIT_THREAD { \
sizeof(init_stack) + (unsigned long) init_stack, 0, \
.ksp = sizeof(init_stack) + (unsigned long)init_stack, \
PS_S, 0, {(unsigned short *)-1, 0}, \
.usp = 0, \
.ccr = PS_S, \
.esp0 = 0, \
.breakinfo = { \
.addr = (unsigned short *)-1, \
.inst = 0 \
} \
}
}
/*
/*
...
@@ -78,6 +84,7 @@ do { \
...
@@ -78,6 +84,7 @@ do { \
set_fs(USER_DS);
/* reads from user space */
\
set_fs(USER_DS);
/* reads from user space */
\
(_regs)->pc = (_pc); \
(_regs)->pc = (_pc); \
(_regs)->ccr &= 0x00;
/* clear kernel flag */
\
(_regs)->ccr &= 0x00;
/* clear kernel flag */
\
(_regs)->er5 = current->mm->start_data;
/* GOT base */
\
wrusp((unsigned long)(_usp) - sizeof(unsigned long)*3); \
wrusp((unsigned long)(_usp) - sizeof(unsigned long)*3); \
} while(0)
} while(0)
#endif
#endif
...
@@ -88,6 +95,7 @@ do { \
...
@@ -88,6 +95,7 @@ do { \
(_regs)->pc = (_pc); \
(_regs)->pc = (_pc); \
(_regs)->ccr = 0x00;
/* clear kernel flag */
\
(_regs)->ccr = 0x00;
/* clear kernel flag */
\
(_regs)->exr = 0x78;
/* enable all interrupts */
\
(_regs)->exr = 0x78;
/* enable all interrupts */
\
(_regs)->er5 = current->mm->start_data;
/* GOT base */
\
/* 14 = space for retaddr(4), vector(4), er0(4) and ext(2) on stack */
\
/* 14 = space for retaddr(4), vector(4), er0(4) and ext(2) on stack */
\
wrusp(((unsigned long)(_usp)) - 14); \
wrusp(((unsigned long)(_usp)) - 14); \
} while(0)
} while(0)
...
...
include/asm-m68knommu/flat.h
View file @
ebd99675
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
#define flat_argvp_envp_on_stack() 1
#define flat_argvp_envp_on_stack() 1
#define flat_old_ram_flag(flags) (flags)
#define flat_old_ram_flag(flags) (flags)
#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
#define flat_get_addr_from_rp(rp, relval) get_unaligned(rp)
#define flat_get_addr_from_rp(rp, relval
, flags
) get_unaligned(rp)
#define flat_put_addr_at_rp(rp, val, relval) put_unaligned(val,rp)
#define flat_put_addr_at_rp(rp, val, relval) put_unaligned(val,rp)
#define flat_get_relocate_addr(rel) (rel)
#define flat_get_relocate_addr(rel) (rel)
...
...
include/asm-sh/flat.h
View file @
ebd99675
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
#define flat_argvp_envp_on_stack() 1
#define flat_argvp_envp_on_stack() 1
#define flat_old_ram_flag(flags) (flags)
#define flat_old_ram_flag(flags) (flags)
#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
#define flat_get_addr_from_rp(rp, relval) get_unaligned(rp)
#define flat_get_addr_from_rp(rp, relval
, flags
) get_unaligned(rp)
#define flat_put_addr_at_rp(rp, val, relval) put_unaligned(val,rp)
#define flat_put_addr_at_rp(rp, val, relval) put_unaligned(val,rp)
#define flat_get_relocate_addr(rel) (rel)
#define flat_get_relocate_addr(rel) (rel)
...
...
include/asm-v850/flat.h
View file @
ebd99675
...
@@ -45,7 +45,8 @@ flat_get_relocate_addr (unsigned long relval)
...
@@ -45,7 +45,8 @@ flat_get_relocate_addr (unsigned long relval)
RELVAL is the raw relocation-table entry from which RP is derived.
RELVAL is the raw relocation-table entry from which RP is derived.
For the v850, RP should always be half-word aligned. */
For the v850, RP should always be half-word aligned. */
static
inline
unsigned
long
flat_get_addr_from_rp
(
unsigned
long
*
rp
,
static
inline
unsigned
long
flat_get_addr_from_rp
(
unsigned
long
*
rp
,
unsigned
long
relval
)
unsigned
long
relval
,
unsigned
long
flags
)
{
{
short
*
srp
=
(
short
*
)
rp
;
short
*
srp
=
(
short
*
)
rp
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment