Merge change 21956 into eclair
* changes:
Route all log tags with "RIL" prefix to radio buffer.
diff --git a/fastboot/usb_linux.c b/fastboot/usb_linux.c
index 06c62b8..3b40ba7 100644
--- a/fastboot/usb_linux.c
+++ b/fastboot/usb_linux.c
@@ -51,7 +51,9 @@
#include "usb.h"
-#if TRACE_USB
+#define MAX_RETRIES 5
+
+#ifdef TRACE_USB
#define DBG1(x...) fprintf(stderr, x)
#define DBG(x...) fprintf(stderr, x)
#else
@@ -303,7 +305,7 @@
unsigned char *data = (unsigned char*) _data;
unsigned count = 0;
struct usbdevfs_bulktransfer bulk;
- int n;
+ int n, retry;
if(h->ep_in == 0) {
return -1;
@@ -316,16 +318,20 @@
bulk.len = xfer;
bulk.data = data;
bulk.timeout = 0;
-
- DBG("[ usb read %d fd = %d], fname=%s\n", xfer, h->desc, h->fname);
- n = ioctl(h->desc, USBDEVFS_BULK, &bulk);
- DBG("[ usb read %d ] = %d, fname=%s\n", xfer, n, h->fname);
+ retry = 0;
- if(n < 0) {
- DBG1("ERROR: n = %d, errno = %d (%s)\n",
- n, errno, strerror(errno));
- return -1;
+ do{
+ DBG("[ usb read %d fd = %d], fname=%s\n", xfer, h->desc, h->fname);
+ n = ioctl(h->desc, USBDEVFS_BULK, &bulk);
+ DBG("[ usb read %d ] = %d, fname=%s, Retry %d \n", xfer, n, h->fname, retry);
+
+ if( n < 0 ) {
+ DBG1("ERROR: n = %d, errno = %d (%s)\n",n, errno, strerror(errno));
+ if ( ++retry > MAX_RETRIES ) return -1;
+ sleep( 1 );
+ }
}
+ while( n < 0 );
count += n;
len -= n;
diff --git a/libacc/acc.cpp b/libacc/acc.cpp
index 483a1ac..6e19503 100644
--- a/libacc/acc.cpp
+++ b/libacc/acc.cpp
@@ -4891,11 +4891,15 @@
int argCount = 0;
for (Type* pP = pDecl->pTail; pP; pP = pP->pTail) {
Type* pArg = pP->pHead;
- addLocalSymbol(pArg);
+ if (pArg->id) {
+ addLocalSymbol(pArg);
+ }
/* read param name and compute offset */
size_t alignment = pGen->stackAlignmentOf(pArg);
a = (a + alignment - 1) & ~ (alignment-1);
- VI(pArg->id)->pAddress = (void*) a;
+ if (pArg->id) {
+ VI(pArg->id)->pAddress = (void*) a;
+ }
a = a + pGen->stackSizeOf(pArg);
argCount++;
}
diff --git a/libacc/tests/data/funcargs.c b/libacc/tests/data/funcargs.c
new file mode 100644
index 0000000..1dce226
--- /dev/null
+++ b/libacc/tests/data/funcargs.c
@@ -0,0 +1,8 @@
+int f(int a,int, int c) {
+ return a + c;
+}
+
+int main() {
+ return f(1,2,3);
+}
+
diff --git a/libacc/tests/test.py b/libacc/tests/test.py
index ed20334..ab85f10 100644
--- a/libacc/tests/test.py
+++ b/libacc/tests/test.py
@@ -14,11 +14,15 @@
def parseArgv():
global gUseArm
+ global gUseX86
global gRunOTCCOutput
for arg in sys.argv[1:]:
if arg == "--noarm":
- print "--noarm detected, not testing on ARM"
+ print "--noarm: not testing ARM"
gUseArm = False
+ elif arg == "--nox86":
+ print "--nox86: not testing x86"
+ gUseX86 = False
elif arg == "--norunotcc":
print "--norunotcc detected, not running OTCC output"
gRunOTCCOutput = False
@@ -439,6 +443,11 @@
result: 3
""","""""")
+ def testFuncArgs(self):
+ self.compileCheck(["-R", "data/funcargs.c"], """Executing compiled code:
+result: 4
+""","""""")
+
def main():
parseArgv()
if not outputCanRun():