/*1* linux/arch/arm/lib/putuser.S2*3* Copyright (C) 2001 Russell King4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License version 2 as7* published by the Free Software Foundation.8*9* Idea from x86 version, (C) Copyright 1998 Linus Torvalds10*11* These functions have a non-standard call interface to make12* them more efficient, especially as they return an error13* value in addition to the "real" return value.14*15* __put_user_X16*17* Inputs: r0 contains the address18* r2, r3 contains the value19* Outputs: r0 is the error code20* lr corrupted21*22* No other registers must be altered. (see <asm/uaccess.h>23* for specific ASM register usage).24*25* Note that ADDR_LIMIT is either 0 or 0xc000000026* Note also that it is intended that __put_user_bad is not global.27*/28#include <linux/linkage.h>29#include <asm/errno.h>30#include <asm/domain.h>3132ENTRY(__put_user_1)331: T(strb) r2, [r0]34mov r0, #035mov pc, lr36ENDPROC(__put_user_1)3738ENTRY(__put_user_2)39mov ip, r2, lsr #840#ifdef CONFIG_THUMB2_KERNEL41#ifndef __ARMEB__422: T(strb) r2, [r0]433: T(strb) ip, [r0, #1]44#else452: T(strb) ip, [r0]463: T(strb) r2, [r0, #1]47#endif48#else /* !CONFIG_THUMB2_KERNEL */49#ifndef __ARMEB__502: T(strb) r2, [r0], #1513: T(strb) ip, [r0]52#else532: T(strb) ip, [r0], #1543: T(strb) r2, [r0]55#endif56#endif /* CONFIG_THUMB2_KERNEL */57mov r0, #058mov pc, lr59ENDPROC(__put_user_2)6061ENTRY(__put_user_4)624: T(str) r2, [r0]63mov r0, #064mov pc, lr65ENDPROC(__put_user_4)6667ENTRY(__put_user_8)68#ifdef CONFIG_THUMB2_KERNEL695: T(str) r2, [r0]706: T(str) r3, [r0, #4]71#else725: T(str) r2, [r0], #4736: T(str) r3, [r0]74#endif75mov r0, #076mov pc, lr77ENDPROC(__put_user_8)7879__put_user_bad:80mov r0, #-EFAULT81mov pc, lr82ENDPROC(__put_user_bad)8384.pushsection __ex_table, "a"85.long 1b, __put_user_bad86.long 2b, __put_user_bad87.long 3b, __put_user_bad88.long 4b, __put_user_bad89.long 5b, __put_user_bad90.long 6b, __put_user_bad91.popsection929394