Skip to content

Commit dda5350

Browse files
Evgueni DrioukEvgueni Driouk
authored andcommitted
Added evaluation of "Dcdecp" attribute in conditions
1 parent 2f24b9e commit dda5350

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

com.arm.cmsis.pack.common/src/com/arm/cmsis/pack/common/CmsisConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ public class CmsisConstants {
118118
public static final String DENDIAN = "Dendian"; //$NON-NLS-1$
119119
public static final String DCLOCK = "Dclock"; //$NON-NLS-1$
120120
public static final String DMVE = "Dmve"; //$NON-NLS-1$
121+
public static final String DCDECP = "Dcdecp"; //$NON-NLS-1$
121122

122123
public static final String MVE = "MVE"; //$NON-NLS-1$
123124
public static final String NO_MVE = "NO_MVE"; //$NON-NLS-1$

com.arm.cmsis.pack.data/src/com/arm/cmsis/pack/data/CpAttributes.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import com.arm.cmsis.pack.utils.DeviceVendor;
1818

1919
/**
20-
* Class that overrides some methods from generic Attributes
20+
* Class that overrides some methods from generic Attributes
2121
*/
2222
public class CpAttributes extends Attributes {
2323

@@ -32,13 +32,18 @@ public CpAttributes() {
3232
public CpAttributes(IAttributes copyFrom) {
3333
super(copyFrom);
3434
}
35-
36-
35+
36+
3737
@Override
3838
public boolean matchAttribute(String key, String value, String pattern) {
39-
if(key.equals(CmsisConstants.DVENDOR)) {
39+
if(CmsisConstants.DVENDOR.equals(key)) {
4040
return DeviceVendor.match(value, pattern);
4141
}
42+
if (CmsisConstants.DCDECP.equals(key)) { // CDE support
43+
long lval = IAttributes.stringToLong(value, 0L);
44+
long lpat = IAttributes.stringToLong(pattern, 0L);
45+
return (lval & lpat) != 0; // alternatively considered (lval & lpat) == lpat
46+
}
4247
return super.matchAttribute(key, value, pattern);
4348
}
4449

0 commit comments

Comments
 (0)