56 lines
1.6 KiB
Diff
56 lines
1.6 KiB
Diff
Subject: [PATCH/RFC] m68k: Wrap nfblock natfeat calls
|
|
|
|
From: Geert Uytterhoeven <geert@linux-m68k.org>
|
|
|
|
Add wrappers with proper prototypes for the natfeat calls in nfblock.
|
|
This fixes the problem where sector_t was pushed on the stack as a 64-bit value
|
|
if CONFIG_LBD=y, while all parameters of the nf_call() varargs function are
|
|
32-bit.
|
|
---
|
|
arch/m68k/emu/nfblock.c | 20 +++++++++++++++++---
|
|
1 file changed, 17 insertions(+), 3 deletions(-)
|
|
|
|
--- a/arch/m68k/emu/nfblock.c
|
|
+++ b/arch/m68k/emu/nfblock.c
|
|
@@ -30,6 +30,20 @@ enum {
|
|
NFHD_DEV_OFFSET = 8,
|
|
};
|
|
|
|
+static inline s32 nfhd_read_write(u32 major, u32 minor, u32 rwflag, u32 recno,
|
|
+ u32 count, u32 buf)
|
|
+{
|
|
+ return nf_call(nfhd_id + NFHD_READ_WRITE, major, minor, rwflag, recno,
|
|
+ count, buf);
|
|
+}
|
|
+
|
|
+static inline s32 nfhd_get_capacity(u32 major, u32 minor, u32 *blocks,
|
|
+ u32 *blocksize)
|
|
+{
|
|
+ return nf_call(nfhd_id + NFHD_GET_CAPACITY, major, minor, blocks,
|
|
+ blocksize);
|
|
+}
|
|
+
|
|
static LIST_HEAD(nfhd_list);
|
|
|
|
static int major_num;
|
|
@@ -56,8 +70,8 @@ static int nfhd_make_request(struct requ
|
|
bio_for_each_segment(bvec, bio, i) {
|
|
len = bvec->bv_len;
|
|
len >>= 9;
|
|
- nf_call(nfhd_id + NFHD_READ_WRITE, dev->id, 0, dir,
|
|
- sec >> shift, len >> shift, bvec_to_phys(bvec));
|
|
+ nfhd_read_write(dev->id, 0, dir, sec >> shift, len >> shift,
|
|
+ bvec_to_phys(bvec));
|
|
sec += len;
|
|
}
|
|
bio_endio(bio, 0);
|
|
@@ -152,7 +166,7 @@ static int __init nfhd_init(void)
|
|
}
|
|
|
|
for (i = NFHD_DEV_OFFSET; i < 24; i++) {
|
|
- if (nf_call(nfhd_id + NFHD_GET_CAPACITY, i, 0, &blocks, &bsize))
|
|
+ if (nfhd_get_capacity(i, 0, &blocks, &bsize))
|
|
continue;
|
|
nfhd_init_one(i, blocks, bsize);
|
|
}
|