From 10df96d0bf6378f2d6ede7bfb27f21af41c309d5 Mon Sep 17 00:00:00 2001 From: Wael El-Essawy Date: Fri, 20 Nov 2015 13:47:12 -0600 Subject: OCC GPE0: Core Data Collection infrastructure in GPE0 Create IPC function for core data collection return dummy data at this point to allow 405 to schedule and "use" data back. Change-Id: I520e9333fa25e37127d6af693ad6f21da3431939 RTC: 131183 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/22247 Reviewed-by: Fadi Kassem Reviewed-by: Wael Elessawy Tested-by: Fadi Kassem --- src/occ_gpe0/gpe_core_data.c | 76 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 src/occ_gpe0/gpe_core_data.c (limited to 'src/occ_gpe0/gpe_core_data.c') diff --git a/src/occ_gpe0/gpe_core_data.c b/src/occ_gpe0/gpe_core_data.c new file mode 100644 index 0000000..d4b56c5 --- /dev/null +++ b/src/occ_gpe0/gpe_core_data.c @@ -0,0 +1,76 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/occ_gpe0/core_data.c $ */ +/* */ +/* OpenPOWER OnChipController Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2015 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#include "core_data.h" +#include "ipc_async_cmd.h" +#include "gpe_err.h" +#include "gpe_util.h" +#include "proc_shared.h" + +/* + * Function Specifications: + * + * Name: gpe_get_core_data + * + * Description: extract core number, call get_core data with the + * proper core id and pointer to CoreData + * + * Inputs: cmd is a pointer to IPC msg's cmd and cmd_data struct + * + * Outputs: error: sets rc, address, and ffdc in the cmd_data's + * GpeErrorStruct + * + * End Function Specification + */ + + +void gpe_get_core_data(ipc_msg_t* cmd, void* arg) +{ + uint32_t rc; // return code + ipc_async_cmd_t *async_cmd = (ipc_async_cmd_t*)cmd; + ipc_core_data_parms_t *args = (ipc_core_data_parms_t*) async_cmd->cmd_data; + + + rc = get_core_data(args->core_num, // core ID + args->data); // CoreData* + + if(rc) + { + PK_TRACE("gpe_get_core_data: get_core_data failed, rc = 0x%08x, core = 0x%08x", + rc, args->core_num); + gpe_set_ffdc(&(args->error), args->core_num, + GPE_RC_GET_CORE_DATA_FAILED, rc); + } + + // send back a response, IPC success even if ffdc/rc are non zeros + rc = ipc_send_rsp(cmd, IPC_RC_SUCCESS); + if(rc) + { + PK_TRACE("gpe_get_core_data: Failed to send response back. Halting GPE0", rc); + gpe_set_ffdc(&(args->error), 0x00, GPE_RC_IPC_SEND_FAILED, rc); + pk_halt(); + } + +} -- cgit v1.2.1