From: Dave A. <ai...@us...> - 2001-03-11 13:59:07
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/lib In directory usw-pr-cvs1:/tmp/cvs-serv28187 Modified Files: string_user.c Makefile Added Files: strncpy_user.S Log Message: implemented strncpy_from_user... first of many ... copy/to/from should be next ... then strnlen the strncpy bit seems correct .. the fixup/exception table stuff not sure about --- NEW FILE --- /* * $ID$ * * Copyright (C) 2001, Dave Airlie * * VAX Assembly implementation of strncpy_from_user */ #include <asm/errno.h> #include <linux/linkage.h> /* int __strncpy_from_user(char *dst, const char *src, long count) * Returns number of bytes copied */ .text ENTRY(__strncpy_from_user) .word 0x3e movl 4(ap), r2 /* r2 now has dst */ movl 8(ap), r3 /* r3 now has src */ movl 12(ap), r0 /* r0 has count */ movl r0, r1 /* keep count in r1 */ beql 2f 1: movb (r3)+, r4 movb r4, (r2)+ cmpb $0, r4 beql 2f sobgtr r1, 1b 2: subl2 r1, r0 ret .section .fixup, "ax" 3: movl r0, -EFAULT ret .previous .section __ex_table, "a" .align 4 .long 1b, 3b .previous Index: string_user.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/lib/string_user.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- string_user.c 2001/02/05 00:08:02 1.1 +++ string_user.c 2001/03/11 14:00:58 1.2 @@ -22,12 +22,6 @@ } -int __strncpy_from_user(char *dst, const char *src, long count) -{ - panic("__strncpy_from_user: not implemented"); -} - - extern long __strlen_user(const char *s) { panic("__strlen_user: not implemented"); Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/lib/Makefile,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Makefile 2001/03/03 13:01:55 1.8 +++ Makefile 2001/03/11 14:00:58 1.9 @@ -12,7 +12,7 @@ all: libio.a L_TARGET := libio.a -obj-y := string.o string_user.o console.o negdi.o checksum.o lshrdi3.o +obj-y := string.o string_user.o console.o negdi.o checksum.o lshrdi3.o strncpy_user.o include $(TOPDIR)/Rules.make |