Vishal Bhoj | 82c8071 | 2015-12-15 21:13:33 +0530 | [diff] [blame^] | 1 | /** @file
|
| 2 | *
|
| 3 | * Copyright (c) 2011-2012, ARM Limited. All rights reserved.
|
| 4 | * Copyright (c) Huawei Technologies Co., Ltd. 2013. All rights reserved.
|
| 5 | *
|
| 6 | * 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 <Uefi.h>
|
| 17 | #include <Library/IoLib.h>
|
| 18 | #include <Library/ArmGicLib.h>
|
| 19 | #include <Library/PcdLib.h>
|
| 20 |
|
| 21 | UINTN
|
| 22 | EFIAPI
|
| 23 | ArmGicGetMaxNumInterrupts (
|
| 24 | IN INTN GicDistributorBase
|
| 25 | )
|
| 26 | {
|
| 27 | return 32 * ((MmioRead32 (GicDistributorBase + ARM_GIC_ICDICTR) & 0x1F) + 1);
|
| 28 | }
|
| 29 |
|
| 30 | VOID
|
| 31 | EFIAPI
|
| 32 | ArmGicSendSgiTo (
|
| 33 | IN INTN GicDistributorBase,
|
| 34 | IN INTN TargetListFilter,
|
| 35 | IN INTN CPUTargetList,
|
| 36 | IN INTN SgiId
|
| 37 | )
|
| 38 | {
|
| 39 | MmioWrite32 (GicDistributorBase + ARM_GIC_ICDSGIR, ((TargetListFilter & 0x3) << 24) | ((CPUTargetList & 0xFF) << 16) | SgiId);
|
| 40 | }
|
| 41 |
|