copystr.S (239268) | copystr.S (248361) |
---|---|
1/* $NetBSD: copystr.S,v 1.8 2002/10/13 14:54:48 bjh21 Exp $ */ 2 3/*- 4 * Copyright (c) 1995 Mark Brinicombe. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 29 unchanged lines hidden (view full) --- 38 * Created : 16/05/95 39 */ 40 41 42#include "assym.s" 43#include <machine/asm.h> 44#include <machine/armreg.h> 45#include <machine/asmacros.h> | 1/* $NetBSD: copystr.S,v 1.8 2002/10/13 14:54:48 bjh21 Exp $ */ 2 3/*- 4 * Copyright (c) 1995 Mark Brinicombe. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 29 unchanged lines hidden (view full) --- 38 * Created : 16/05/95 39 */ 40 41 42#include "assym.s" 43#include <machine/asm.h> 44#include <machine/armreg.h> 45#include <machine/asmacros.h> |
46__FBSDID("$FreeBSD: head/sys/arm/arm/copystr.S 239268 2012-08-15 03:03:03Z gonzo $"); | 46__FBSDID("$FreeBSD: head/sys/arm/arm/copystr.S 248361 2013-03-16 02:48:49Z andrew $"); |
47 48#include <sys/errno.h> 49 50 .text 51 .align 0 52 53#ifdef _ARM_ARCH_6 54#define GET_PCB(tmp) \ --- 33 unchanged lines hidden (view full) --- 88 moveq r0, #0x00000000 89 movne r0, #ENAMETOOLONG 90 912: teq r3, #0x00000000 92 strne r5, [r3] 93 94 ldmfd sp!, {r4-r5} /* stack is 8 byte aligned */ 95 RET | 47 48#include <sys/errno.h> 49 50 .text 51 .align 0 52 53#ifdef _ARM_ARCH_6 54#define GET_PCB(tmp) \ --- 33 unchanged lines hidden (view full) --- 88 moveq r0, #0x00000000 89 movne r0, #ENAMETOOLONG 90 912: teq r3, #0x00000000 92 strne r5, [r3] 93 94 ldmfd sp!, {r4-r5} /* stack is 8 byte aligned */ 95 RET |
96END(copystr) |
|
96 97#define SAVE_REGS stmfd sp!, {r4-r6} 98#define RESTORE_REGS ldmfd sp!, {r4-r6} 99 100/* 101 * r0 - user space address 102 * r1 - kernel space address 103 * r2 - maxlens --- 34 unchanged lines hidden (view full) --- 138 moveq r0, #0x00000000 139 movne r0, #ENAMETOOLONG 140 1412: teq r3, #0x00000000 142 strne r6, [r3] 143 144 RESTORE_REGS 145 RET | 97 98#define SAVE_REGS stmfd sp!, {r4-r6} 99#define RESTORE_REGS ldmfd sp!, {r4-r6} 100 101/* 102 * r0 - user space address 103 * r1 - kernel space address 104 * r2 - maxlens --- 34 unchanged lines hidden (view full) --- 139 moveq r0, #0x00000000 140 movne r0, #ENAMETOOLONG 141 1422: teq r3, #0x00000000 143 strne r6, [r3] 144 145 RESTORE_REGS 146 RET |
147END(copyinstr) |
|
146 147/* 148 * r0 - kernel space address 149 * r1 - user space address 150 * r2 - maxlens 151 * r3 - lencopied 152 * 153 * Copy string from kernel space to user space --- 31 unchanged lines hidden (view full) --- 185 moveq r0, #0x00000000 186 movne r0, #ENAMETOOLONG 187 1882: teq r3, #0x00000000 189 strne r6, [r3] 190 191 RESTORE_REGS 192 RET | 148 149/* 150 * r0 - kernel space address 151 * r1 - user space address 152 * r2 - maxlens 153 * r3 - lencopied 154 * 155 * Copy string from kernel space to user space --- 31 unchanged lines hidden (view full) --- 187 moveq r0, #0x00000000 188 movne r0, #ENAMETOOLONG 189 1902: teq r3, #0x00000000 191 strne r6, [r3] 192 193 RESTORE_REGS 194 RET |
195END(copyoutstr) |
|
193 194/* A fault occurred during the copy */ 195.Lcopystrfault: 196 mov r1, #0x00000000 197 str r1, [r4, #PCB_ONFAULT] 198 RESTORE_REGS 199 RET 200 --- 12 unchanged lines hidden --- | 196 197/* A fault occurred during the copy */ 198.Lcopystrfault: 199 mov r1, #0x00000000 200 str r1, [r4, #PCB_ONFAULT] 201 RESTORE_REGS 202 RET 203 --- 12 unchanged lines hidden --- |