Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
e92caaf5
Commit
e92caaf5
authored
May 07, 2004
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
All io processes and thread supervises all other with halt action
parent
db5dc0fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
32 deletions
+50
-32
src/lib/rt/src/rt_csup.c
src/lib/rt/src/rt_csup.c
+49
-32
src/lib/rt/src/rt_csup.h
src/lib/rt/src/rt_csup.h
+1
-0
No files found.
src/lib/rt/src/rt_csup.c
View file @
e92caaf5
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#include "pwr_class.h"
#include "pwr_class.h"
#include "pwrb_c_cyclesup.h"
#include "pwrb_c_cyclesup.h"
#include "co_time.h"
#include "co_time.h"
#include "co_cdh.h"
#include "rt_gdh.h"
#include "rt_gdh.h"
#include "rt_gdh_msg.h"
#include "rt_gdh_msg.h"
#include "rt_csup_msg.h"
#include "rt_csup_msg.h"
...
@@ -34,6 +35,7 @@ csup_Init (
...
@@ -34,6 +35,7 @@ csup_Init (
{
{
lst_sEntry
*
lh
;
lst_sEntry
*
lh
;
pwr_tObjid
cid
;
pwr_tObjid
cid
;
pwr_tObjid
pid
;
csup_sObject
*
cp
;
csup_sObject
*
cp
;
int
tv_sec
;
int
tv_sec
;
pwr_tFloat32
max_delay
;
pwr_tFloat32
max_delay
;
...
@@ -47,9 +49,9 @@ csup_Init (
...
@@ -47,9 +49,9 @@ csup_Init (
lst_Init
(
NULL
,
lh
,
NULL
);
lst_Init
(
NULL
,
lh
,
NULL
);
for
(
for
(
*
sts
=
gdh_GetC
hild
(
tid
,
&
cid
);
*
sts
=
gdh_GetC
lassList
(
pwr_cClass_CycleSup
,
&
cid
);
ODD
(
*
sts
);
ODD
(
*
sts
);
*
sts
=
gdh_GetNext
Sibling
(
cid
,
&
cid
)
*
sts
=
gdh_GetNext
Object
(
cid
,
&
cid
)
)
{
)
{
cp
=
calloc
(
1
,
sizeof
(
*
cp
));
cp
=
calloc
(
1
,
sizeof
(
*
cp
));
cp
->
aref
.
Objid
=
cid
;
cp
->
aref
.
Objid
=
cid
;
...
@@ -57,12 +59,14 @@ csup_Init (
...
@@ -57,12 +59,14 @@ csup_Init (
if
(
EVEN
(
*
sts
))
if
(
EVEN
(
*
sts
))
goto
error
;
goto
error
;
if
(
ODD
(
gdh_GetParent
(
cid
,
&
pid
))
&&
cdh_ObjidIsEqual
(
pid
,
tid
))
cp
->
is_owner
=
1
;
lst_InsertSucc
(
NULL
,
lh
,
&
cp
->
le
,
cp
);
lst_InsertSucc
(
NULL
,
lh
,
&
cp
->
le
,
cp
);
max_delay
=
cp
->
o
->
MaxDelay
;
max_delay
=
cp
->
o
->
MaxDelay
;
cp
->
o
->
DelayLimit
.
tv_sec
=
tv_sec
=
(
int
)
max_delay
;
cp
->
o
->
DelayLimit
.
tv_sec
=
tv_sec
=
(
int
)
max_delay
;
cp
->
o
->
DelayLimit
.
tv_nsec
=
(
int
)((
max_delay
-
(
float
)
tv_sec
+
FLT_EPSILON
)
*
1.0e9
);
cp
->
o
->
DelayLimit
.
tv_nsec
=
(
int
)((
max_delay
-
(
float
)
tv_sec
+
FLT_EPSILON
)
*
1.0e9
);
printf
(
"maxdelay: %f, tv_sec: %d, tv_nsec: %d
\n
"
,
cp
->
o
->
MaxDelay
,
// printf("maxdelay: %f, tv_sec: %d, tv_nsec: %d\n", cp->o->MaxDelay, cp->o->DelayLimit.tv_sec, cp->o->DelayLimit.tv_nsec);
cp
->
o
->
DelayLimit
.
tv_sec
,
cp
->
o
->
DelayLimit
.
tv_nsec
);
errh_Info
(
"maxdelay: %f, tv_sec: %d, tv_nsec: %d"
,
cp
->
o
->
MaxDelay
,
errh_Info
(
"maxdelay: %f, tv_sec: %d, tv_nsec: %d"
,
cp
->
o
->
MaxDelay
,
cp
->
o
->
DelayLimit
.
tv_sec
,
cp
->
o
->
DelayLimit
.
tv_nsec
);
cp
->
o
->
DelayLimit
.
tv_sec
,
cp
->
o
->
DelayLimit
.
tv_nsec
);
}
}
...
@@ -98,40 +102,53 @@ csup_Exec (
...
@@ -98,40 +102,53 @@ csup_Exec (
while
((
cp
=
lst_Succ
(
NULL
,
lh
,
&
lh
))
!=
NULL
)
{
while
((
cp
=
lst_Succ
(
NULL
,
lh
,
&
lh
))
!=
NULL
)
{
pwr_sClass_CycleSup
*
o
=
cp
->
o
;
pwr_sClass_CycleSup
*
o
=
cp
->
o
;
if
(
time_Dcomp
(
&
o
->
NextLimit
,
NULL
)
>
0
)
{
if
(
cp
->
is_owner
)
{
if
(
time_Dcomp
(
stop
,
&
o
->
NextLimit
)
>
0
)
{
if
(
time_Dcomp
(
&
o
->
NextLimit
,
NULL
)
>
0
)
{
if
(
!
o
->
Delayed
)
{
if
(
time_Dcomp
(
stop
,
&
o
->
NextLimit
)
>
0
)
{
o
->
DelayedTime
=
*
now
;
if
(
!
o
->
Delayed
)
{
o
->
Delayed
=
TRUE
;
o
->
DelayedTime
=
*
now
;
o
->
Timely
=
FALSE
;
o
->
Delayed
=
TRUE
;
o
->
Timely
=
FALSE
;
}
o
->
DelayCount
++
;
o
->
LastDelay
=
*
now
;
action
=
MAX
(
action
,
o
->
DelayAction
);
}
else
if
(
!
o
->
Timely
)
{
o
->
Timely
=
TRUE
;
o
->
TimelyTime
=
*
now
;
}
}
o
->
DelayCount
++
;
o
->
LastDelay
=
*
now
;
action
=
MAX
(
action
,
o
->
DelayAction
);
}
else
if
(
!
o
->
Timely
)
{
o
->
Timely
=
TRUE
;
o
->
TimelyTime
=
*
now
;
}
}
}
if
((
o
->
DelayLimit
.
tv_sec
&
1
<<
31
)
!=
(
o
->
DelayLimit
.
tv_nsec
&
1
<<
31
))
{
if
((
o
->
DelayLimit
.
tv_sec
&
1
<<
31
)
!=
(
o
->
DelayLimit
.
tv_nsec
&
1
<<
31
))
{
// printf("DelayLimit.tv_sec: %d, DelayLimit.tv_nsec: %d\n", o->DelayLimit.tv_sec, o->DelayLimit.tv_nsec);
printf
(
"DelayLimit.tv_sec: %d, DelayLimit.tv_nsec: %d
\n
"
,
o
->
DelayLimit
.
tv_sec
,
o
->
DelayLimit
.
tv_nsec
);
errh_Info
(
"DelayLimit.tv_sec: %d, DelayLimit.tv_nsec: %d"
,
o
->
DelayLimit
.
tv_sec
,
o
->
DelayLimit
.
tv_nsec
);
errh_Info
(
"DelayLimit.tv_sec: %d, DelayLimit.tv_nsec: %d"
,
o
->
DelayLimit
.
tv_sec
,
o
->
DelayLimit
.
tv_nsec
);
}
}
if
((
next_start
->
tv_sec
&
1
<<
31
)
!=
(
next_start
->
tv_nsec
&
1
<<
31
))
{
if
((
next_start
->
tv_sec
&
1
<<
31
)
!=
(
next_start
->
tv_nsec
&
1
<<
31
))
{
// printf("next_start->tv_sec: %d, next_start->tv_nsec: %d\n", next_start->tv_sec, next_start->tv_nsec);
printf
(
"next_start->tv_sec: %d, next_start->tv_nsec: %d
\n
"
,
next_start
->
tv_sec
,
next_start
->
tv_nsec
);
errh_Info
(
"next_start->tv_sec: %d, next_start->tv_nsec: %d"
,
next_start
->
tv_sec
,
next_start
->
tv_nsec
);
errh_Info
(
"next_start->tv_sec: %d, next_start->tv_nsec: %d"
,
next_start
->
tv_sec
,
next_start
->
tv_nsec
);
}
}
time_Dadd
(
&
nextLimit
,
next_start
,
&
o
->
DelayLimit
);
time_Dadd
(
&
nextLimit
,
next_start
,
&
o
->
DelayLimit
);
/* If we update the tv_nsec field first it is
/* If we update the tv_nsec field first it is
possible that emon will detect a slip even if it is not. */
possible that emon will detect a slip even if it is not. */
o
->
NextLimit
.
tv_sec
=
nextLimit
.
tv_sec
;
o
->
NextLimit
.
tv_sec
=
nextLimit
.
tv_sec
;
o
->
NextLimit
.
tv_nsec
=
nextLimit
.
tv_nsec
;
o
->
NextLimit
.
tv_nsec
=
nextLimit
.
tv_nsec
;
o
->
CycleCount
++
;
o
->
CycleCount
++
;
}
else
{
/* Not owner, check stall delay */
if
(
o
->
DelayAction
==
2
)
{
if
(
time_Dcomp
(
&
o
->
NextLimit
,
NULL
)
>
0
&&
time_Dcomp
(
stop
,
&
o
->
NextLimit
)
>
0
)
{
o
->
DelayCount
++
;
o
->
LastDelay
=
*
now
;
action
=
MAX
(
action
,
o
->
DelayAction
);
}
}
}
}
}
return
action
;
return
action
;
}
}
...
...
src/lib/rt/src/rt_csup.h
View file @
e92caaf5
...
@@ -17,6 +17,7 @@ typedef struct {
...
@@ -17,6 +17,7 @@ typedef struct {
pwr_sClass_CycleSup
*
o
;
pwr_sClass_CycleSup
*
o
;
pwr_sAttrRef
aref
;
pwr_sAttrRef
aref
;
pwr_tDlid
dlid
;
pwr_tDlid
dlid
;
int
is_owner
;
}
csup_sObject
;
}
csup_sObject
;
void
csup_Exit
(
pwr_tStatus
*
,
lst_sEntry
*
);
void
csup_Exit
(
pwr_tStatus
*
,
lst_sEntry
*
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment