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
8c6407f0
Commit
8c6407f0
authored
Dec 02, 2004
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New interpretation of enum and mask
parent
4bfdd690
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
181 additions
and
2 deletions
+181
-2
src/lib/rt/src/rt_csup.c
src/lib/rt/src/rt_csup.c
+1
-1
src/lib/rt/src/rt_gdh.c
src/lib/rt/src/rt_gdh.c
+145
-1
src/lib/rt/src/rt_gdh.h
src/lib/rt/src/rt_gdh.h
+35
-0
No files found.
src/lib/rt/src/rt_csup.c
View file @
8c6407f0
...
...
@@ -12,7 +12,7 @@
#include <float.h>
#include "pwr.h"
#include "pwr_class.h"
#include "pwr
b_c_cyclesup
.h"
#include "pwr
_baseclasses
.h"
#include "co_time.h"
#include "co_cdh.h"
#include "rt_gdh.h"
...
...
src/lib/rt/src/rt_gdh.c
View file @
8c6407f0
...
...
@@ -866,7 +866,7 @@ gdh_GetAttrRefTid (
}
gdh_ScopeUnlock
;
if
(
ap
!=
NULL
)
*
tid
=
ap
->
tid
;
*
tid
=
ap
->
adef
->
TypeRef
;
return
sts
;
}
...
...
@@ -3315,6 +3315,150 @@ gdh_GetSuperClass(
return
sts
;
}
pwr_tStatus
gdh_GetEnumValueDef
(
pwr_tTid
tid
,
gdh_sValueDef
**
vd
,
int
*
rows
)
{
gdb_sObject
*
top
;
gdb_sObject
*
vop
;
pwr_tOid
valoid
;
int
vcnt
;
pwr_tStatus
sts
=
GDH__SUCCESS
;
pwr_sValue
*
valp
;
gdh_ScopeLock
{
top
=
vol_OidToObject
(
&
sts
,
cdh_TypeIdToObjid
(
tid
),
gdb_mLo_local
,
vol_mTrans_none
,
cvol_eHint_none
);
if
(
top
==
NULL
)
goto
error_sts
;
if
(
!
top
->
g
.
flags
.
b
.
isParent
)
{
sts
=
GDH__NOSUCHOBJ
;
goto
error_sts
;
}
vcnt
=
0
;
valoid
=
top
->
g
.
soid
;
vop
=
vol_OidToObject
(
&
sts
,
valoid
,
gdb_mLo_local
,
vol_mTrans_none
,
cvol_eHint_none
);
if
(
vop
==
NULL
)
goto
error_sts
;
while
(
1
)
{
valoid
.
oix
=
vop
->
g
.
sib
.
blink
;
if
(
valoid
.
oix
==
top
->
g
.
soid
.
oix
)
break
;
vop
=
vol_OidToObject
(
&
sts
,
valoid
,
gdb_mLo_local
,
vol_mTrans_none
,
cvol_eHint_none
);
if
(
vop
==
NULL
)
goto
error_sts
;
if
(
vop
->
g
.
cid
==
pwr_eClass_Value
)
vcnt
++
;
}
/* Allocate buffer */
*
vd
=
(
gdh_sValueDef
*
)
calloc
(
vcnt
,
sizeof
(
gdh_sValueDef
));
*
rows
=
vcnt
;
vcnt
=
0
;
valoid
=
top
->
g
.
soid
;
vop
=
vol_OidToObject
(
&
sts
,
valoid
,
gdb_mLo_local
,
vol_mTrans_none
,
cvol_eHint_none
);
if
(
vop
==
NULL
)
goto
error_sts
;
while
(
1
)
{
valoid
.
oix
=
vop
->
g
.
sib
.
blink
;
if
(
valoid
.
oix
==
top
->
g
.
soid
.
oix
)
break
;
vop
=
vol_OidToObject
(
&
sts
,
valoid
,
gdb_mLo_local
,
vol_mTrans_none
,
cvol_eHint_none
);
if
(
vop
==
NULL
)
goto
error_sts
;
if
(
vop
->
g
.
cid
==
pwr_eClass_Value
)
{
valp
=
(
pwr_sValue
*
)
vol_ObjectToAddress
(
&
sts
,
vop
);
if
(
valp
==
NULL
)
goto
error_sts
;
strcpy
(
(
*
vd
)[
vcnt
].
Name
,
vop
->
g
.
f
.
name
.
orig
);
(
*
vd
)[
vcnt
].
Value
=
valp
;
vcnt
++
;
}
}
error_sts:
{
}
}
gdh_ScopeUnlock
;
return
sts
;
}
pwr_tStatus
gdh_GetMaskBitDef
(
pwr_tTid
tid
,
gdh_sBitDef
**
bd
,
int
*
rows
)
{
gdb_sObject
*
top
;
gdb_sObject
*
bop
;
pwr_tOid
boid
;
int
bcnt
;
pwr_tStatus
sts
=
GDH__SUCCESS
;
pwr_sBit
*
bp
;
gdh_ScopeLock
{
top
=
vol_OidToObject
(
&
sts
,
cdh_TypeIdToObjid
(
tid
),
gdb_mLo_local
,
vol_mTrans_none
,
cvol_eHint_none
);
if
(
top
==
NULL
)
goto
error_sts
;
if
(
!
top
->
g
.
flags
.
b
.
isParent
)
{
sts
=
GDH__NOSUCHOBJ
;
goto
error_sts
;
}
bcnt
=
0
;
boid
=
top
->
g
.
soid
;
bop
=
vol_OidToObject
(
&
sts
,
boid
,
gdb_mLo_local
,
vol_mTrans_none
,
cvol_eHint_none
);
if
(
bop
==
NULL
)
goto
error_sts
;
while
(
1
)
{
boid
.
oix
=
bop
->
g
.
sib
.
blink
;
if
(
boid
.
oix
==
top
->
g
.
soid
.
oix
)
break
;
bop
=
vol_OidToObject
(
&
sts
,
boid
,
gdb_mLo_local
,
vol_mTrans_none
,
cvol_eHint_none
);
if
(
bop
==
NULL
)
goto
error_sts
;
if
(
bop
->
g
.
cid
==
pwr_eClass_Bit
)
bcnt
++
;
}
/* Allocate buffer */
*
bd
=
(
gdh_sBitDef
*
)
calloc
(
bcnt
,
sizeof
(
gdh_sBitDef
));
*
rows
=
bcnt
;
bcnt
=
0
;
boid
=
top
->
g
.
soid
;
bop
=
vol_OidToObject
(
&
sts
,
boid
,
gdb_mLo_local
,
vol_mTrans_none
,
cvol_eHint_none
);
if
(
bop
==
NULL
)
goto
error_sts
;
while
(
1
)
{
boid
.
oix
=
bop
->
g
.
sib
.
blink
;
if
(
boid
.
oix
==
top
->
g
.
soid
.
oix
)
break
;
bop
=
vol_OidToObject
(
&
sts
,
boid
,
gdb_mLo_local
,
vol_mTrans_none
,
cvol_eHint_none
);
if
(
bop
==
NULL
)
goto
error_sts
;
if
(
bop
->
g
.
cid
==
pwr_eClass_Bit
)
{
bp
=
(
pwr_sBit
*
)
vol_ObjectToAddress
(
&
sts
,
bop
);
if
(
bp
==
NULL
)
goto
error_sts
;
strcpy
(
(
*
bd
)[
bcnt
].
Name
,
bop
->
g
.
f
.
name
.
orig
);
(
*
bd
)[
bcnt
].
Bit
=
bp
;
bcnt
++
;
}
}
error_sts:
{
}
}
gdh_ScopeUnlock
;
return
sts
;
}
...
...
src/lib/rt/src/rt_gdh.h
View file @
8c6407f0
...
...
@@ -118,6 +118,27 @@ typedef struct {
}
gdh_sAttrDef
;
/**
* Enum value info
*/
typedef
struct
{
pwr_tObjName
Name
;
/**< Value name */
pwr_sValue
*
Value
;
/**< Pointer to value object */
}
gdh_sValueDef
;
/**
* Mask bit info
*/
typedef
struct
{
pwr_tObjName
Name
;
/**< Value name */
pwr_sBit
*
Bit
;
/**< Pointer to bit object */
}
gdh_sBitDef
;
/* GDH entrypoints (as function prototypes). */
/** @} */
...
...
@@ -723,6 +744,20 @@ gdh_GetSuperClass(
pwr_tCid
*
supercid
);
pwr_tStatus
gdh_GetEnumValueDef
(
pwr_tTid
tid
,
gdh_sValueDef
**
vd
,
int
*
rows
);
pwr_tStatus
gdh_GetMaskBitDef
(
pwr_tTid
tid
,
gdh_sBitDef
**
bd
,
int
*
rows
);
/* Undocumented routines. For internal use only. */
pwr_tStatus
...
...
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