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:
Bart Van Assche
2013-08-04 17:41:33 +00:00
parent a7458cded0
commit 752aec49c7
3 changed files with 25 additions and 10 deletions

View File

@@ -109,7 +109,7 @@ function specialize_patch {
if [ "${enable_specialize}" = "true" ]; then
"$(dirname $0)/specialize-patch" \
${specialize_patch_options} \
-v kernel_version="${kver}" \
-v kernel_version="${kver3}" \
-v SCSI_EXEC_REQ_FIFO_DEFINED="${scsi_exec_req_fifo_defined}" \
-v SCST_IO_CONTEXT="${scst_io_context}" \
| if [ "${generating_upstream_patch}" = "true" ]; then
@@ -210,6 +210,12 @@ fi
# Strip patch level from the kernel version number.
kver="$(kernel_version "$1")"
# kver3: first three components of the version number.
if [ "${1#2.}" != "$1" ]; then
kver3="$kver"
else
kver3="$1"
fi
# Include fcst in the patch for kernel versions 2.6.33 and later.
if [ "${kver}" ">" "2.6.32" ]; then

View File

@@ -338,7 +338,7 @@ function run_sparse {
&& make -s prepare \
&& make -s scripts \
&& if grep -q '^CONFIG_PPC=y$' .config; then LC_ALL=C make -k M=arch/powerpc/lib; fi \
&& LC_ALL=C make -k C=2 CF=-D__CHECK_ENDIAN__ M="${subdir}" "$@"
&& LC_ALL=C make -k C=2 CF="-D__CHECK_ENDIAN__ -DCONFIG_SPARSE_RCU_POINTER" M="${subdir}" "$@"
) &> "${outputfile}"
then
local errors=$(grep -c ' error:' "${outputfile}")

View File

@@ -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)