/*1* linux/arch/arm/lib/getuser.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 make them more12* efficient, especially as they return an error value in addition to13* the "real" return value.14*15* __get_user_X16*17* Inputs: r0 contains the address18* Outputs: r0 is the error code19* r2, r3 contains the zero-extended value20* 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 0xc0000000.26* Note also that it is intended that __get_user_bad is not global.27*/28#include <linux/linkage.h>29#include <asm/errno.h>30#include <asm/domain.h>3132ENTRY(__get_user_1)331: T(ldrb) r2, [r0]34mov r0, #035mov pc, lr36ENDPROC(__get_user_1)3738ENTRY(__get_user_2)39#ifdef CONFIG_THUMB2_KERNEL402: T(ldrb) r2, [r0]413: T(ldrb) r3, [r0, #1]42#else432: T(ldrb) r2, [r0], #1443: T(ldrb) r3, [r0]45#endif46#ifndef __ARMEB__47orr r2, r2, r3, lsl #848#else49orr r2, r3, r2, lsl #850#endif51mov r0, #052mov pc, lr53ENDPROC(__get_user_2)5455ENTRY(__get_user_4)564: T(ldr) r2, [r0]57mov r0, #058mov pc, lr59ENDPROC(__get_user_4)6061__get_user_bad:62mov r2, #063mov r0, #-EFAULT64mov pc, lr65ENDPROC(__get_user_bad)6667.pushsection __ex_table, "a"68.long 1b, __get_user_bad69.long 2b, __get_user_bad70.long 3b, __get_user_bad71.long 4b, __get_user_bad72.popsection737475