]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/ArmLib/Arm9/Arm9Lib.c
ArmPkg: Made ArmConfigureMmu() returns a status code
[mirror_edk2.git] / ArmPkg / Library / ArmLib / Arm9 / Arm9Lib.c
index c92f9159c66d42cd3a3f89c3b755fa87ce6a4ae3..1acb158019254ff608c84bc0071520f5237e79d7 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
 \r
   Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
+  Copyright (c) 2011 - 2013, ARM Limited. All rights reserved.\r
   \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -62,18 +63,21 @@ FillTranslationTable (
   }\r
 }\r
 \r
-VOID\r
+RETURN_STATUS\r
 EFIAPI\r
 ArmConfigureMmu (\r
   IN  ARM_MEMORY_REGION_DESCRIPTOR  *MemoryTable,\r
-  OUT VOID                          **TranslationTableBase OPTIONAL,\r
-  OUT UINTN                         *TranslationTableSize  OPTIONAL\r
+  OUT VOID                         **TranslationTableBase OPTIONAL,\r
+  OUT UINTN                         *TranslationTableSize OPTIONAL\r
   )\r
 {\r
   VOID  *TranslationTable;\r
 \r
   // Allocate pages for translation table.\r
-  TranslationTable = AllocatePages(EFI_SIZE_TO_PAGES(TRANSLATION_TABLE_SIZE + TRANSLATION_TABLE_ALIGNMENT));\r
+  TranslationTable = AllocatePages (EFI_SIZE_TO_PAGES (TRANSLATION_TABLE_SIZE + TRANSLATION_TABLE_ALIGNMENT));\r
+  if (TranslationTable == NULL) {\r
+    return RETURN_OUT_OF_RESOURCES;\r
+  }\r
   TranslationTable = (VOID *)(((UINTN)TranslationTable + TRANSLATION_TABLE_ALIGNMENT_MASK) & ~TRANSLATION_TABLE_ALIGNMENT_MASK);\r
 \r
   if (TranslationTableBase != NULL) {\r
@@ -125,7 +129,6 @@ ArmConfigureMmu (
   ArmEnableInstructionCache();\r
   ArmEnableDataCache();\r
   ArmEnableMmu();\r
-}\r
-\r
-\r
 \r
+  return RETURN_SUCCESS;\r
+}\r