xFSTK  1.8.1-5.311
Intel SoC Cross Platform Firmware & Software Tool Kit
xfstk-dldr-example-parallel/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
Dlthread::run
void run()
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:108
status
void status(char *message, void *clientdata)
Definition: xfstk-dldr-example-parallel-dynamic-load/xfstk-dldr-example-parallel.cpp:38
it_done
list< void * >::iterator it_done
Definition: xfstk-dldr-example-parallel-dynamic-load/xfstk-dldr-example-parallel.cpp:52
thread_rectype::threadobj
void * threadobj
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.h:49
Sleepms
void Sleepms(int delay)
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:130
xfstkstatuspfn
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
arg_type::gpflags
string gpflags
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.h:42
failtargets
int failtargets
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:45
xfstkdldrapi.h
totaltargets
int totaltargets
Definition: xfstk-dldr-example-parallel-dynamic-load/xfstk-dldr-example-parallel.cpp:53
list_done
list< void * > list_done
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:40
arg_type::osdnx
string osdnx
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.h:40
xfstkdealloc
PXFSTKDEALLOC xfstkdealloc
Definition: xfstk-dldr-example-parallel-dynamic-load/xfstk-dldr-example-parallel.cpp:35
xfstkalloc
PXFSTKALLOC xfstkalloc
Definition: xfstk-dldr-example-parallel-dynamic-load/xfstk-dldr-example-parallel.cpp:34
arg_type::fwimage
string fwimage
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.h:39
Dlthread::obj
DlThreadObj * obj
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.h:75
arg_type::usbsn
string usbsn
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.h:43
failtargets
int failtargets
Definition: xfstk-dldr-example-parallel-dynamic-load/xfstk-dldr-example-parallel.cpp:55
list_running
list< void * > list_running
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:39
Dlthread::setobj
void setobj(DlThreadObj *obj)
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:104
list_running
list< void * > list_running
Definition: xfstk-dldr-example-parallel-dynamic-load/xfstk-dldr-example-parallel.cpp:49
Dlthread::done
void done()
Dlthread::Dlthread
Dlthread(QObject *parent=0)
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:95
ghMutex
QMutex ghMutex
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:25
totaltargets
int totaltargets
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:43
list_usbsn
list< string > list_usbsn
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:37
it_usbsn
list< string >::iterator it_usbsn
Definition: xfstk-dldr-example-parallel-dynamic-load/xfstk-dldr-example-parallel.cpp:48
main
int main(int argc, char *argv[])
Definition: xfstk-dldr-example-parallel-dynamic-load/xfstk-dldr-example-parallel.cpp:155
thread_rectype::hthread
void * hthread
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.h:51
Dlthread
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.h:70
arg_type::osimage
string osimage
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.h:41
arg_type::statuscallback
xfstkstatuspfn statuscallback
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.h:45
list_done
list< void * > list_done
Definition: xfstk-dldr-example-parallel-dynamic-load/xfstk-dldr-example-parallel.cpp:50
arg_type::fwdnx
string fwdnx
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.h:38
xfstkdldrapi::settargetretrycount
virtual void settargetretrycount(int retries)
Sets the number of retries to perform during faulty USB I/O.
list_usbsn
list< string > list_usbsn
Definition: xfstk-dldr-example-parallel-dynamic-load/xfstk-dldr-example-parallel.cpp:47
it_usbsn
list< string >::iterator it_usbsn
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:38
status
void status(char *message, void *clientdata)
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:28
donetargets
int donetargets
Definition: xfstk-dldr-example-parallel-dynamic-load/xfstk-dldr-example-parallel.cpp:54
xfstkdldrapi::getlasterror
virtual bool getlasterror(LastError *er)
Get the Last error from XFSTK API version string.
IsContains
bool IsContains(list< void * > *list_checking, string *usbsn)
Definition: xfstk-dldr-example-parallel-dynamic-load/xfstk-dldr-example-parallel.cpp:130
xfstkdldrapi::setwipeifwi
virtual void setwipeifwi(bool enable)
Not a POR feature, only a testing/debug feature.
xfstkdldrapi::getavailabletargets
virtual int getavailabletargets()
Reports the number of available targets connected to the host system.
DlThreadObj::DoWork
void DoWork()
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:90
PXFSTKALLOC
xfstkdldrapi *(* PXFSTKALLOC)()
Definition: xfstk-dldr-example-parallel-dynamic-load/xfstk-dldr-example-parallel.cpp:30
LastError::error_code
unsigned long error_code
Definition: xfstkdldrapi.h:68
PXFSTKDEALLOC
void(* PXFSTKDEALLOC)(xfstkdldrapi *)
Definition: xfstk-dldr-example-parallel-dynamic-load/xfstk-dldr-example-parallel.cpp:31
xfstkdldrapi::registerstatuscallback
virtual bool registerstatuscallback(xfstkstatuspfn statuspfn, void *clientdata)
Registers a callback with the xfstk api in order to obtain download status information.
DlThreadObj
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.h:55
hinstLib
void * hinstLib
Definition: xfstk-dldr-example-parallel-dynamic-load/xfstk-dldr-example-parallel.cpp:33
ghListMutex
QMutex ghListMutex
Definition: xfstk-dldr-example-parallel-dynamic-load/xfstk-dldr-example-parallel.cpp:27
Dlthread::~Dlthread
~Dlthread()
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:99
it_running
list< void * >::iterator it_running
Definition: xfstk-dldr-example-parallel-dynamic-load/xfstk-dldr-example-parallel.cpp:51
LastError::error_message
char error_message[128]
Definition: xfstkdldrapi.h:69
ghListMutex
QMutex ghListMutex
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:26
arg_type
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.h:37
xfstk-dldr-example-parallel.h
thread_rectype
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.h:48
Sleepms
void Sleepms(int delay)
Definition: xfstk-dldr-example-parallel-dynamic-load/xfstk-dldr-example-parallel.cpp:145
xfstkdldrapi::setusbreadwritedelay
virtual void setusbreadwritedelay(unsigned long delayms)
Set the delay time for before each USB bulk read/write in miliseconds.
DlThreadObj::Arg
void Arg(void *a)
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.h:61
it_running
list< void * >::iterator it_running
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:41
thread_rectype::usbsn
string usbsn
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.h:50
arg_type::softfuse
string softfuse
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.h:44
main
int main(int argc, char *argv[])
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:138
DlThreadObj::DldrRun
void DldrRun(void *)
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:47
it_done
list< void * >::iterator it_done
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:42
xfstkdldrapi
Definition: xfstkdldrapi.h:124
ghMutex
QMutex ghMutex
Definition: xfstk-dldr-example-parallel-dynamic-load/xfstk-dldr-example-parallel.cpp:26
IsContains
bool IsContains(list< void * > *list_checking, string *usbsn)
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:115
DlThreadObj::Arg
void * Arg() const
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.h:60
LastError
The last error happened during download.
Definition: xfstkdldrapi.h:67
donetargets
int donetargets
Definition: xfstk-dldr-example-parallel/xfstk-dldr-example-parallel.cpp:44
xfstkdldrapi::downloadmtfwosasync
virtual bool downloadmtfwosasync(char *fwdnx, char *fwimage, char *osdnx, char *osimage, char *gpflags, char *usbsn)
Performs parallel multitarget firmware and operating system download in async mode,...