summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/C/GenBootSector/GetDrvNumOffset.c
diff options
context:
space:
mode:
authorShenglei Zhang <shenglei.zhang@intel.com>2018-11-30 10:30:05 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2018-12-06 14:32:04 +0800
commit7702ceb8afa4f94b949eca4fbbc5dc84e550e082 (patch)
treef46c6064b2081f5735926d6b245ae23b8f594f65 /BaseTools/Source/C/GenBootSector/GetDrvNumOffset.c
parent9fb5c5c4a33248764b24cb710b56d6c32ce237b4 (diff)
downloadedk2-7702ceb8afa4f94b949eca4fbbc5dc84e550e082.tar.gz
edk2-7702ceb8afa4f94b949eca4fbbc5dc84e550e082.tar.bz2
edk2-7702ceb8afa4f94b949eca4fbbc5dc84e550e082.zip
BaseTools: Remove tools only used by DuetPkg
Given that DuetPkg will be removed, tools only used by DuetPkg can also be removed after its removal operation. https://bugzilla.tianocore.org/show_bug.cgi?id=1322 v2:Remove these tools in Makefile and GNUmakefile. v4:Remove these tools in BinWrappers/PosixLike/ and UserManuals. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/C/GenBootSector/GetDrvNumOffset.c')
-rw-r--r--BaseTools/Source/C/GenBootSector/GetDrvNumOffset.c73
1 files changed, 0 insertions, 73 deletions
diff --git a/BaseTools/Source/C/GenBootSector/GetDrvNumOffset.c b/BaseTools/Source/C/GenBootSector/GetDrvNumOffset.c
deleted file mode 100644
index ab6944ef2a..0000000000
--- a/BaseTools/Source/C/GenBootSector/GetDrvNumOffset.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/** @file
-
- Get Drv Num offset from Fat file system.
-
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <stdio.h>
-#include "FatFormat.h"
-
-INTN
-GetDrvNumOffset (
- IN VOID *BootSector
- )
-{
- FAT_BPB_STRUCT *FatBpb;
- UINTN RootDirSectors;
- UINTN FATSz;
- UINTN TotSec;
- UINTN DataSec;
- UINTN CountOfClusters;
-
- FatBpb = (FAT_BPB_STRUCT *) BootSector;
-
- //
- // Check FAT type algorithm from FAT spec
- //
- RootDirSectors = ((FatBpb->Fat12_16.BPB_RootEntCnt * sizeof(FAT_DIRECTORY_ENTRY)) +
- (FatBpb->Fat12_16.BPB_BytsPerSec - 1)) / FatBpb->Fat12_16.BPB_BytsPerSec;
-
- if (FatBpb->Fat12_16.BPB_FATSz16 != 0) {
- FATSz = FatBpb->Fat12_16.BPB_FATSz16;
- } else {
- FATSz = FatBpb->Fat32.BPB_FATSz32;
- }
- if (FATSz == 0) {
- fprintf (stderr, "error E3003: FAT - BPB_FATSz16, BPB_FATSz32 - 0, expected: Non-Zero number\n");
- return -1;
- }
-
- if (FatBpb->Fat12_16.BPB_TotSec16 != 0) {
- TotSec = FatBpb->Fat12_16.BPB_TotSec16;
- } else {
- TotSec = FatBpb->Fat12_16.BPB_TotSec32;
- }
- if (TotSec == 0) {
- fprintf (stderr, "error E3003: FAT - BPB_TotSec16, BPB_TotSec32 - 0, expected: Non-Zero number\n");
- return -1;
- }
-
- DataSec = TotSec - (
- FatBpb->Fat12_16.BPB_RsvdSecCnt +
- FatBpb->Fat12_16.BPB_NumFATs * FATSz +
- RootDirSectors
- );
-
- CountOfClusters = DataSec / FatBpb->Fat12_16.BPB_SecPerClus;
-
- if (CountOfClusters < FAT_MAX_FAT16_CLUSTER) {
- return (INTN) ((UINTN) &FatBpb->Fat12_16.BS_DrvNum - (UINTN) FatBpb);
- } else {
- return (INTN) ((UINTN) &FatBpb->Fat32.BS_DrvNum - (UINTN) FatBpb);
- }
-}
-