]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Arm/GccInline.c
Update to make end-of-line consistent for all source files in MdePkg. There are no...
[mirror_edk2.git] / MdePkg / Library / BaseLib / Arm / GccInline.c
1 /** @file
2 GCC inline implementation of BaseLib processor specific functions.
3
4 Copyright (c) 2006 - 2007, Intel Corporation<BR>
5 Portions copyright (c) 2008-2009 Apple Inc.<BR>
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #include "BaseLibInternals.h"
17
18 /**
19 Requests CPU to pause for a short period of time.
20
21 Requests CPU to pause for a short period of time. Typically used in MP
22 systems to prevent memory starvation while waiting for a spin lock.
23
24 **/
25 VOID
26 EFIAPI
27 CpuPause (
28 VOID
29 )
30 {
31 __asm__ __volatile__ (
32 "nop\n\t"
33 "nop\n\t"
34 "nop\n\t"
35 "nop\n\t"
36 "nop\n\t"
37 );
38 }
39
40 VOID
41 EFIAPI
42 InternalSwitchStackAsm (
43 SWITCH_STACK_ENTRY_POINT EntryPoint,
44 VOID *Context,
45 VOID *Context2,
46 VOID *NewStack
47 )
48 {
49 __asm__ __volatile__ (
50 "mov lr, %0\n\t"
51 "mov sp, %3\n\t"
52 "mov %r0, %1\n\t"
53 "mov %r1, %2\n\t"
54 "bx lr\n\t"
55 : /* no output operand */
56 : "r" (EntryPoint),
57 "r" (Context),
58 "r" (Context2),
59 "r" (NewStack)
60 );
61 }