xFSTK  0.0.0
Intel SoC Cross Platform Firmware & Software Tool Kit
xfstk-dldr-example-parallel.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2015 Intel Corporation
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 #ifndef XFSTKDLDREXAMPLEPARALLEL_H
19 #define XFSTKDLDREXAMPLEPARALLEL_H
20 #include <QtCore/QCoreApplication>
21 #include <QMutex>
22 #include <QObject>
23 #include <QThread>
24 #include "xfstkdldrapi.h"
25 #include <stdlib.h>
26 #include <stdio.h>
27 #include <sstream>
28 #include <iostream>
29 #include <fstream>
30 #include <list>
31 #include <time.h>
32 #include <utility>
33 #include <sys/stat.h>
34 
35 using namespace std;
36 
37 typedef struct {
38  string fwdnx;
39  string fwimage;
40  string osdnx;
41  string osimage;
42  string gpflags;
43  string usbsn;
44  string softfuse;
46 } arg_type;
47 
48 typedef struct {
49  void* threadobj;
50  string usbsn;
51  void* hthread;
53 
54 class DlThreadObj : public QObject
55 {
56  Q_OBJECT
57 
58 public:
59  void DldrRun(void*);
60  void * Arg() const {return Arg_;}
61  void Arg(void* a){Arg_ = a;}
62  void DoWork();
63 private:
64  unsigned int ThreadId_;
65  void * Arg_;
66 
67 };
68 
69 class Dlthread : public QThread
70 {
71 Q_OBJECT
72 public:
73  explicit Dlthread(QObject *parent = 0);
74  ~Dlthread();
76  void setobj(DlThreadObj *obj);
77 signals:
78  void done();
79 
80 public slots:
81 protected:
82  void run();
83 
84 };
85 #endif // XFSTKDLDREXAMPLEPARALLEL_H
string fwimage
Definition: xfstk-dldr-example-parallel.h:39
string usbsn
Definition: xfstk-dldr-example-parallel.h:43
string fwdnx
Definition: xfstk-dldr-example-parallel.h:38
string softfuse
Definition: xfstk-dldr-example-parallel.h:44
void * Arg() const
Definition: xfstk-dldr-example-parallel.h:60
DlThreadObj * obj
Definition: xfstk-dldr-example-parallel.h:75
string usbsn
Definition: xfstk-dldr-example-parallel.h:50
Definition: xfstk-dldr-example-parallel.h:69
void * threadobj
Definition: xfstk-dldr-example-parallel.h:49
string gpflags
Definition: xfstk-dldr-example-parallel.h:42
Definition: xfstk-dldr-example-parallel.h:37
void * hthread
Definition: xfstk-dldr-example-parallel.h:51
string osimage
Definition: xfstk-dldr-example-parallel.h:41
void Arg(void *a)
Definition: xfstk-dldr-example-parallel.h:61
Definition: xfstk-dldr-example-parallel.h:54
void(* xfstkstatuspfn)(char *status, void *)
Represents an optional status callback function that can be provided to xfstk API to obtain status in...
Definition: xfstkdldrapi.h:113
string osdnx
Definition: xfstk-dldr-example-parallel.h:40
xfstkstatuspfn statuscallback
Definition: xfstk-dldr-example-parallel.h:45
Definition: xfstk-dldr-example-parallel.h:48