summaryrefslogtreecommitdiffstats
path: root/mboxd.c
diff options
context:
space:
mode:
authorDeepak Kodihalli <dkodihal@in.ibm.com>2017-05-01 06:36:02 -0500
committerDeepak Kodihalli <dkodihal@in.ibm.com>2017-06-27 08:40:32 -0500
commit6c2fa90d498acff8a1c319c883c3bbf89282bdfe (patch)
treec853936772e426629f5153c71bcf1ba4e814cf43 /mboxd.c
parentb6a446f9070e6a8f044227ed74269aeb627cd1af (diff)
downloadphosphor-mboxd-6c2fa90d498acff8a1c319c883c3bbf89282bdfe.tar.gz
phosphor-mboxd-6c2fa90d498acff8a1c319c883c3bbf89282bdfe.zip
msg: handle partition table read request
Map host's request to read the flash at offset less than the partition table length as a request to read the pnor partition table. Resolves openbmc/openbmc#1439. Change-Id: I0f5b98f073d983b0d4749b0aba84b37d7f42f884 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Diffstat (limited to 'mboxd.c')
-rw-r--r--mboxd.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mboxd.c b/mboxd.c
index 5f851df..c418543 100644
--- a/mboxd.c
+++ b/mboxd.c
@@ -51,6 +51,7 @@
#include "mboxd_lpc.h"
#include "mboxd_msg.h"
#include "mboxd_windows.h"
+#include "mboxd_pnor_partition_table.h"
#define USAGE \
"\nUsage: %s [-V | --version] [-h | --help] [-v[v] | --verbose] [-s | --syslog]\n" \
@@ -311,6 +312,10 @@ int main(int argc, char **argv)
MSG_INFO("Starting Daemon\n");
+#ifdef VIRTUAL_PNOR_ENABLED
+ vpnor_create_partition_table(context);
+#endif
+
rc = init_signals(context, &set);
if (rc) {
goto finish;
@@ -367,6 +372,9 @@ finish:
free_lpc_dev(context);
free_mbox_dev(context);
free_windows(context);
+#ifdef VIRTUAL_PNOR_ENABLED
+ vpnor_destroy_partition_table(context);
+#endif
free(context);
return rc;
OpenPOWER on IntegriCloud