mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-05 01:54:09 +08:00
Merge branch 'for-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k
Pull m68k fixes from Geert Uytterhoeven: "These are two critical fixes, needed by distro kernels, and thus also destined for stable: - The do_div() commit fixes a crash in mounting btrfs volumes, which was a regression from 3.2, - The ARAnyM fix allows to have NatFeat drivers as loadable modules, which is needed for initrds" * 'for-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k: Truncate base in do_div() m68k/atari: ARAnyM - Fix NatFeat module support
This commit is contained in:
commit
359d16ca1b
@ -18,9 +18,11 @@
|
||||
#include <asm/machdep.h>
|
||||
#include <asm/natfeat.h>
|
||||
|
||||
extern long nf_get_id2(const char *feature_name);
|
||||
|
||||
asm("\n"
|
||||
" .global nf_get_id,nf_call\n"
|
||||
"nf_get_id:\n"
|
||||
" .global nf_get_id2,nf_call\n"
|
||||
"nf_get_id2:\n"
|
||||
" .short 0x7300\n"
|
||||
" rts\n"
|
||||
"nf_call:\n"
|
||||
@ -29,12 +31,25 @@ asm("\n"
|
||||
"1: moveq.l #0,%d0\n"
|
||||
" rts\n"
|
||||
" .section __ex_table,\"a\"\n"
|
||||
" .long nf_get_id,1b\n"
|
||||
" .long nf_get_id2,1b\n"
|
||||
" .long nf_call,1b\n"
|
||||
" .previous");
|
||||
EXPORT_SYMBOL_GPL(nf_get_id);
|
||||
EXPORT_SYMBOL_GPL(nf_call);
|
||||
|
||||
long nf_get_id(const char *feature_name)
|
||||
{
|
||||
/* feature_name may be in vmalloc()ed memory, so make a copy */
|
||||
char name_copy[32];
|
||||
size_t n;
|
||||
|
||||
n = strlcpy(name_copy, feature_name, sizeof(name_copy));
|
||||
if (n >= sizeof(name_copy))
|
||||
return 0;
|
||||
|
||||
return nf_get_id2(name_copy);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(nf_get_id);
|
||||
|
||||
void nfprint(const char *fmt, ...)
|
||||
{
|
||||
static char buf[256];
|
||||
|
@ -15,16 +15,17 @@
|
||||
unsigned long long n64; \
|
||||
} __n; \
|
||||
unsigned long __rem, __upper; \
|
||||
unsigned long __base = (base); \
|
||||
\
|
||||
__n.n64 = (n); \
|
||||
if ((__upper = __n.n32[0])) { \
|
||||
asm ("divul.l %2,%1:%0" \
|
||||
: "=d" (__n.n32[0]), "=d" (__upper) \
|
||||
: "d" (base), "0" (__n.n32[0])); \
|
||||
: "=d" (__n.n32[0]), "=d" (__upper) \
|
||||
: "d" (__base), "0" (__n.n32[0])); \
|
||||
} \
|
||||
asm ("divu.l %2,%1:%0" \
|
||||
: "=d" (__n.n32[1]), "=d" (__rem) \
|
||||
: "d" (base), "1" (__upper), "0" (__n.n32[1])); \
|
||||
: "=d" (__n.n32[1]), "=d" (__rem) \
|
||||
: "d" (__base), "1" (__upper), "0" (__n.n32[1])); \
|
||||
(n) = __n.n64; \
|
||||
__rem; \
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user