Lines Matching refs:nPartitionID
520 static TEEC_Result partitionDestroy(uint32_t nPartitionID) in partitionDestroy() argument
524 if (g_pPartitionFiles[nPartitionID] != NULL) in partitionDestroy()
533 if (unlink(g_pPartitionNames[nPartitionID]) != 0) in partitionDestroy()
536 if (_unlink(g_pPartitionNames[nPartitionID]) != 0) in partitionDestroy()
552 static TEEC_Result partitionCreate(uint32_t nPartitionID) in partitionCreate() argument
556 if (g_pPartitionFiles[nPartitionID] != NULL) in partitionCreate()
564 LogInfo("Create storage file \"%s\"", g_pPartitionNames[nPartitionID]); in partitionCreate()
565 g_pPartitionFiles[nPartitionID] = fopen(g_pPartitionNames[nPartitionID], "w+b"); in partitionCreate()
567 if (g_pPartitionFiles[nPartitionID] == NULL) in partitionCreate()
569 LogError("Cannot create storage file \"%s\"", g_pPartitionNames[nPartitionID]); in partitionCreate()
585 static TEEC_Result partitionOpen(uint32_t nPartitionID, uint32_t* pnPartitionSize) in partitionOpen() argument
589 if (g_pPartitionFiles[nPartitionID] != NULL) in partitionOpen()
597 g_pPartitionFiles[nPartitionID] = fopen(g_pPartitionNames[nPartitionID], "r+b"); in partitionOpen()
598 if (g_pPartitionFiles[nPartitionID] == NULL) in partitionOpen()
603 LogError("Storage file \"%s\" does not exist", g_pPartitionNames[nPartitionID]); in partitionOpen()
609 LogError("cannot open storage file \"%s\"", g_pPartitionNames[nPartitionID]); in partitionOpen()
615 fseek(g_pPartitionFiles[nPartitionID], 0L, SEEK_END); in partitionOpen()
616 *pnPartitionSize = ftell(g_pPartitionFiles[nPartitionID]) / g_nSectorSize; in partitionOpen()
619 g_pPartitionNames[nPartitionID], in partitionOpen()
633 static TEEC_Result partitionClose(uint32_t nPartitionID) in partitionClose() argument
635 if (g_pPartitionFiles[nPartitionID] == NULL) in partitionClose()
640 fclose(g_pPartitionFiles[nPartitionID]); in partitionClose()
641 g_pPartitionFiles[nPartitionID] = NULL; in partitionClose()
652 static TEEC_Result partitionRead(uint32_t nPartitionID, uint32_t nSectorIndex, uint32_t nWorkspaceO… in partitionRead() argument
657 nPartitionID, nSectorIndex, nWorkspaceOffset); in partitionRead()
659 pFile = g_pPartitionFiles[nPartitionID]; in partitionRead()
696 static TEEC_Result partitionWrite(uint32_t nPartitionID, uint32_t nSectorIndex, uint32_t nWorkspace… in partitionWrite() argument
701 nPartitionID, nSectorIndex, nWorkspaceOffset); in partitionWrite()
703 pFile = g_pPartitionFiles[nPartitionID]; in partitionWrite()
734 static TEEC_Result partitionSetSize(uint32_t nPartitionID, uint32_t nNewSectorCount) in partitionSetSize() argument
739 pFile = g_pPartitionFiles[nPartitionID]; in partitionSetSize()
799 static TEEC_Result partitionSync(uint32_t nPartitionID) in partitionSync() argument
804 FILE* pFile = g_pPartitionFiles[nPartitionID]; in partitionSync()
1002 uint32_t nPartitionID = (nInstructionID & 0xF0) >> 4; in runSession() local
1003 … if (g_pExchangeBuffer->sAdministrativeData.nPartitionErrorStates[nPartitionID] == S_SUCCESS) in runSession()
1010 nError = partitionCreate(nPartitionID); in runSession()
1011 … TRACE_INFO("INSTRUCTION: ID=0x%x pid=%d err=%d", (nInstructionID & 0x0F), nPartitionID, nError); in runSession()
1016 nError = partitionOpen(nPartitionID, &nPartitionSize); in runSession()
1017 …NSTRUCTION: ID=0x%x pid=%d pSize=%d err=%d", (nInstructionID & 0x0F), nPartitionID, nPartitionSize… in runSession()
1020 … g_pExchangeBuffer->sAdministrativeData.nPartitionOpenSizes[nPartitionID] = nPartitionSize; in runSession()
1039 nError = partitionRead(nPartitionID, nSectorID, nWorkspaceOffset); in runSession()
1040 …TION: ID=0x%x pid=%d sid=%d woff=%d err=%d", (nInstructionID & 0x0F), nPartitionID, nSectorID, nWo… in runSession()
1058 nError = partitionWrite(nPartitionID, nSectorID, nWorkspaceOffset); in runSession()
1059 …TION: ID=0x%x pid=%d sid=%d woff=%d err=%d", (nInstructionID & 0x0F), nPartitionID, nSectorID, nWo… in runSession()
1063 nError = partitionSync(nPartitionID); in runSession()
1064 … TRACE_INFO("INSTRUCTION: ID=0x%x pid=%d err=%d", (nInstructionID & 0x0F), nPartitionID, nError); in runSession()
1082 nError = partitionSetSize(nPartitionID, nNewSize); in runSession()
1083 …RUCTION: ID=0x%x pid=%d nNewSize=%d err=%d", (nInstructionID & 0x0F), nPartitionID, nNewSize, nErr… in runSession()
1087 nError = partitionClose(nPartitionID); in runSession()
1088 … TRACE_INFO("INSTRUCTION: ID=0x%x pid=%d err=%d", (nInstructionID & 0x0F), nPartitionID, nError); in runSession()
1091 nError = partitionDestroy(nPartitionID); in runSession()
1092 … TRACE_INFO("INSTRUCTION: ID=0x%x pid=%d err=%d", (nInstructionID & 0x0F), nPartitionID, nError); in runSession()
1095 g_pExchangeBuffer->sAdministrativeData.nPartitionErrorStates[nPartitionID] = nError; in runSession()