mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-21 20:51:27 +00:00
Merge from trunk
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.x@4938 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -31,8 +31,8 @@
|
||||
# the KERNEL_VERSION() macro.
|
||||
|
||||
function version_code(kver, array) {
|
||||
if (!match(kver, "([0-9]+).([0-9]+).([0-9]+)", array))
|
||||
match(kver, "([0-9]+).([0-9]+)", array)
|
||||
if (!match(kver, "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$", array))
|
||||
match(kver, "^([0-9]+)\\.([0-9]+)$", array)
|
||||
return 65536*array[1] + 256*array[2] + array[3]
|
||||
}
|
||||
|
||||
@@ -65,6 +65,12 @@ function evaluate(stmnt, pattern, arg, op, result) {
|
||||
|
||||
gsub("LINUX_VERSION_CODE", LINUX_VERSION_CODE, stmnt)
|
||||
|
||||
pattern="KERNEL_VERSION\\([[:blank:]]*([0-9]+)[[:blank:]]*,[[:blank:]]*([0-9]+)[[:blank:]]*,[[:blank:]]*([0-9]+)[[:blank:]]*\\)"
|
||||
while (match(stmnt, pattern, op) != 0)
|
||||
{
|
||||
sub(pattern, op[1] * 65536 + op[2] * 256 + op[3], stmnt)
|
||||
}
|
||||
|
||||
gsub("defined\\(INSIDE_KERNEL_TREE\\)", "1", stmnt)
|
||||
|
||||
gsub("defined\\(BACKPORT_LINUX_WORKQUEUE_TO_2_6_19\\)", "0", stmnt)
|
||||
@@ -151,12 +157,6 @@ function evaluate(stmnt, pattern, arg, op, result) {
|
||||
sub(pattern, op[1] == 0, stmnt)
|
||||
}
|
||||
|
||||
pattern="KERNEL_VERSION\\([[:blank:]]*([0-9]+)[[:blank:]]*,[[:blank:]]*([0-9]+)[[:blank:]]*,[[:blank:]]*([0-9]+)[[:blank:]]*\\)"
|
||||
while (match(stmnt, pattern, op) != 0)
|
||||
{
|
||||
sub(pattern, op[1] * 65536 + op[2] * 256 + op[3], stmnt)
|
||||
}
|
||||
|
||||
pattern="(-*[0-9]+)[[:blank:]]*(\\*|/)[[:blank:]]*(-*[0-9]+)"
|
||||
while (match(stmnt, pattern, op) != 0)
|
||||
{
|
||||
@@ -174,6 +174,15 @@ function evaluate(stmnt, pattern, arg, op, result) {
|
||||
else if (op[2] == "-") result = op[1] - op[3]
|
||||
sub(pattern, result, stmnt)
|
||||
}
|
||||
|
||||
pattern="(-*[0-9]+)[[:blank:]]*(<<|>>)[[:blank:]]*(-*[0-9]+)"
|
||||
while (match(stmnt, pattern, op) != 0)
|
||||
{
|
||||
result="error"
|
||||
if (op[2] == "<<") result = int(op[1] * (2**op[3]))
|
||||
else if (op[2] == ">>") result = int(op[1] / (2**op[3]))
|
||||
sub(pattern, result, stmnt)
|
||||
}
|
||||
|
||||
pattern="(-*[0-9]+)[[:blank:]]*(<|<=|>|>=|==|!=)[[:blank:]]*(-*[0-9]+)"
|
||||
while (match(stmnt, pattern, op) != 0)
|
||||
|
||||
Reference in New Issue
Block a user