? obj-armv4l-unknown-linux-gnu ? xpcom/build/map.out ? xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp.keep Index: dbm/include/extern.h =================================================================== RCS file: /cvsroot/mozilla/dbm/include/extern.h,v retrieving revision 3.2 diff -p -p -r3.2 extern.h *** dbm/include/extern.h 1999/07/15 00:17:16 3.2 --- dbm/include/extern.h 2001/02/16 23:41:06 *************** void __free_ovflpage (HTAB *, BUFHEAD * *** 52,58 **** BUFHEAD *__get_buf (HTAB *, uint32, BUFHEAD *, int); int __get_page (HTAB *, char *, uint32, int, int, int); int __ibitmap (HTAB *, int, int, int); ! uint32 __log2 (uint32); int __put_page (HTAB *, char *, uint32, int, int); void __reclaim_buf (HTAB *, BUFHEAD *); int __split_page (HTAB *, uint32, uint32); --- 52,58 ---- BUFHEAD *__get_buf (HTAB *, uint32, BUFHEAD *, int); int __get_page (HTAB *, char *, uint32, int, int, int); int __ibitmap (HTAB *, int, int, int); ! uint32 __hash_log2 (uint32); int __put_page (HTAB *, char *, uint32, int, int); void __reclaim_buf (HTAB *, BUFHEAD *); int __split_page (HTAB *, uint32, uint32); Index: dbm/include/hash.h =================================================================== RCS file: /cvsroot/mozilla/dbm/include/hash.h,v retrieving revision 3.2 diff -p -p -r3.2 hash.h *** dbm/include/hash.h 1999/07/15 00:17:16 3.2 --- dbm/include/hash.h 2001/02/16 23:41:08 *************** typedef struct htab { /* Memory reside *** 183,189 **** #define OADDR_OF(S,O) ((uint32)((uint32)(S) << SPLITSHIFT) + (O)) #define BUCKET_TO_PAGE(B) \ ! (B) + hashp->HDRPAGES + ((B) ? hashp->SPARES[__log2((uint32)((B)+1))-1] : 0) #define OADDR_TO_PAGE(B) \ BUCKET_TO_PAGE ( (1 << SPLITNUM((B))) -1 ) + OPAGENUM((B)); --- 183,189 ---- #define OADDR_OF(S,O) ((uint32)((uint32)(S) << SPLITSHIFT) + (O)) #define BUCKET_TO_PAGE(B) \ ! (B) + hashp->HDRPAGES + ((B) ? hashp->SPARES[__hash_log2((uint32)((B)+1))-1] : 0) #define OADDR_TO_PAGE(B) \ BUCKET_TO_PAGE ( (1 << SPLITNUM((B))) -1 ) + OPAGENUM((B)); *************** void __free_ovflpage(HTAB *hashp, BUFHEA *** 319,325 **** BUFHEAD * __add_ovflpage(HTAB *hashp, BUFHEAD *bufp); int __big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val); int __expand_table(HTAB *hashp); ! uint32 __log2(uint32 num); void __reclaim_buf(HTAB *hashp, BUFHEAD *bp); int __get_page(HTAB *hashp, char * p, uint32 bucket, int is_bucket, int is_disk, int is_bitmap); int __put_page(HTAB *hashp, char *p, uint32 bucket, int is_bucket, int is_bitmap); --- 319,325 ---- BUFHEAD * __add_ovflpage(HTAB *hashp, BUFHEAD *bufp); int __big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val); int __expand_table(HTAB *hashp); ! uint32 __hash_log2(uint32 num); void __reclaim_buf(HTAB *hashp, BUFHEAD *bp); int __get_page(HTAB *hashp, char * p, uint32 bucket, int is_bucket, int is_disk, int is_bitmap); int __put_page(HTAB *hashp, char *p, uint32 bucket, int is_bucket, int is_bitmap); Index: dbm/src/h_log2.c =================================================================== RCS file: /cvsroot/mozilla/dbm/src/h_log2.c,v retrieving revision 3.1 diff -p -p -r3.1 h_log2.c *** dbm/src/h_log2.c 1998/03/28 03:27:48 3.1 --- dbm/src/h_log2.c 2001/02/16 23:41:09 *************** static char sccsid[] = "@(#)hash_log2.c *** 46,52 **** #endif #include "mcom_db.h" ! uint32 __log2(uint32 num) { register uint32 i, limit; --- 46,52 ---- #endif #include "mcom_db.h" ! uint32 __hash_log2(uint32 num) { register uint32 i, limit; Index: dbm/src/hash.c =================================================================== RCS file: /cvsroot/mozilla/dbm/src/hash.c,v retrieving revision 3.12 diff -p -p -r3.12 hash.c *** dbm/src/hash.c 2000/07/10 20:29:36 3.12 --- dbm/src/hash.c 2001/02/16 23:41:14 *************** init_hash(HTAB *hashp, const char *file, *** 432,444 **** if (hashp->BSIZE > MAX_BSIZE) hashp->BSIZE = MAX_BSIZE; #endif ! hashp->BSHIFT = __log2((uint32)hashp->BSIZE); } if (info) { if (info->bsize) { /* Round pagesize up to power of 2 */ ! hashp->BSHIFT = __log2(info->bsize); hashp->BSIZE = 1 << hashp->BSHIFT; if (hashp->BSIZE > MAX_BSIZE) { errno = EINVAL; --- 432,444 ---- if (hashp->BSIZE > MAX_BSIZE) hashp->BSIZE = MAX_BSIZE; #endif ! hashp->BSHIFT = __hash_log2((uint32)hashp->BSIZE); } if (info) { if (info->bsize) { /* Round pagesize up to power of 2 */ ! hashp->BSHIFT = __hash_log2(info->bsize); hashp->BSIZE = 1 << hashp->BSHIFT; if (hashp->BSIZE > MAX_BSIZE) { errno = EINVAL; *************** init_htab(HTAB *hashp, int nelem) *** 485,491 **** */ nelem = (nelem - 1) / hashp->FFACTOR + 1; ! l2 = __log2((uint32)PR_MAX(nelem, 2)); nbuckets = 1 << l2; hashp->SPARES[l2] = l2 + 1; --- 485,491 ---- */ nelem = (nelem - 1) / hashp->FFACTOR + 1; ! l2 = __hash_log2((uint32)PR_MAX(nelem, 2)); nbuckets = 1 << l2; hashp->SPARES[l2] = l2 + 1; *************** init_htab(HTAB *hashp, int nelem) *** 503,509 **** hashp->BSHIFT) + 1; nsegs = (nbuckets - 1) / hashp->SGSIZE + 1; ! nsegs = 1 << __log2((uint32)nsegs); if (nsegs > hashp->DSIZE) hashp->DSIZE = nsegs; --- 503,509 ---- hashp->BSHIFT) + 1; nsegs = (nbuckets - 1) / hashp->SGSIZE + 1; ! nsegs = 1 << __hash_log2((uint32)nsegs); if (nsegs > hashp->DSIZE) hashp->DSIZE = nsegs; *************** __expand_table(HTAB *hashp) *** 1039,1045 **** * * increases), we need to copy the current contents of the spare * split bucket to the next bucket. */ ! spare_ndx = __log2((uint32)(hashp->MAX_BUCKET + 1)); if (spare_ndx > hashp->OVFL_POINT) { hashp->SPARES[spare_ndx] = hashp->SPARES[hashp->OVFL_POINT]; hashp->OVFL_POINT = spare_ndx; --- 1039,1045 ---- * * increases), we need to copy the current contents of the spare * split bucket to the next bucket. */ ! spare_ndx = __hash_log2((uint32)(hashp->MAX_BUCKET + 1)); if (spare_ndx > hashp->OVFL_POINT) { hashp->SPARES[spare_ndx] = hashp->SPARES[hashp->OVFL_POINT]; hashp->OVFL_POINT = spare_ndx; Index: intl/uconv/public/uconvutil.h =================================================================== RCS file: /cvsroot/mozilla/intl/uconv/public/uconvutil.h,v retrieving revision 1.7 diff -p -p -r1.7 uconvutil.h *** intl/uconv/public/uconvutil.h 1999/11/06 03:23:39 1.7 --- intl/uconv/public/uconvutil.h 2001/02/16 23:41:52 *************** typedef struct { *** 72,103 **** unsigned char MinLB; unsigned char MaxHB; unsigned char MaxLB; ! } uShiftOut; typedef struct { unsigned char Min; unsigned char Max; ! } uShiftIn; typedef struct { unsigned char classID; unsigned char reserveLen; uShiftIn shiftin; uShiftOut shiftout; ! } uShiftCell; typedef struct { PRInt16 numOfItem; PRInt16 classID; uShiftCell shiftcell[1]; ! } uShiftTable; /*=====================================*/ typedef struct { unsigned char min; unsigned char max; ! } uRange; /*=====================================*/ --- 72,103 ---- unsigned char MinLB; unsigned char MaxHB; unsigned char MaxLB; ! } __attribute__((packed)) uShiftOut; typedef struct { unsigned char Min; unsigned char Max; ! } __attribute__((packed)) uShiftIn; typedef struct { unsigned char classID; unsigned char reserveLen; uShiftIn shiftin; uShiftOut shiftout; ! } __attribute__((packed)) uShiftCell; typedef struct { PRInt16 numOfItem; PRInt16 classID; uShiftCell shiftcell[1]; ! } __attribute__((packed,aligned(__alignof__(PRInt16)))) uShiftTable; /*=====================================*/ typedef struct { unsigned char min; unsigned char max; ! } __attribute__((packed)) uRange; /*=====================================*/ Index: intl/uconv/src/umap.h =================================================================== RCS file: /cvsroot/mozilla/intl/uconv/src/umap.h,v retrieving revision 1.2 diff -p -p -r1.2 umap.h *** intl/uconv/src/umap.h 1999/11/06 03:23:45 1.2 --- intl/uconv/src/umap.h 2001/02/16 23:41:53 *************** typedef struct { *** 35,61 **** PRUint16 srcBegin; /* 2 byte */ PRUint16 srcEnd; /* 2 byte */ PRUint16 destBegin; /* 2 byte */ ! } uFormat0; typedef struct { PRUint16 srcBegin; /* 2 byte */ PRUint16 srcEnd; /* 2 byte */ PRUint16 mappingOffset; /* 2 byte */ ! } uFormat1; typedef struct { PRUint16 srcBegin; /* 2 byte */ PRUint16 srcEnd; /* 2 byte -waste */ PRUint16 destBegin; /* 2 byte */ ! } uFormat2; typedef struct { union { uFormat0 format0; uFormat1 format1; uFormat2 format2; ! } fmt; ! } uMapCell; typedef struct { PRUint16 itemOfList; --- 35,61 ---- PRUint16 srcBegin; /* 2 byte */ PRUint16 srcEnd; /* 2 byte */ PRUint16 destBegin; /* 2 byte */ ! } __attribute__((packed,aligned(__alignof__(PRUint16)))) uFormat0; typedef struct { PRUint16 srcBegin; /* 2 byte */ PRUint16 srcEnd; /* 2 byte */ PRUint16 mappingOffset; /* 2 byte */ ! } __attribute__((packed,aligned(__alignof__(PRUint16)))) uFormat1; typedef struct { PRUint16 srcBegin; /* 2 byte */ PRUint16 srcEnd; /* 2 byte -waste */ PRUint16 destBegin; /* 2 byte */ ! } __attribute__((packed,aligned(__alignof__(PRUint16)))) uFormat2; typedef struct { union { uFormat0 format0; uFormat1 format1; uFormat2 format2; ! } __attribute__ ((packed,aligned(__alignof__(PRUint16)))) fmt; ! } __attribute__((packed,aligned(__alignof__(PRUint16)))) uMapCell; typedef struct { PRUint16 itemOfList; *************** typedef struct { *** 63,68 **** PRUint16 offsetToMapCellArray; PRUint16 offsetToMappingTable; PRUint16 data[1]; ! } uTable; #endif --- 63,68 ---- PRUint16 offsetToMapCellArray; PRUint16 offsetToMappingTable; PRUint16 data[1]; ! } __attribute__((packed,aligned(__alignof__(PRUint16)))) uTable; #endif Index: modules/libjar/zipstruct.h =================================================================== RCS file: /cvsroot/mozilla/modules/libjar/zipstruct.h,v retrieving revision 1.4 diff -p -p -r1.4 zipstruct.h *** modules/libjar/zipstruct.h 1999/11/06 03:31:35 1.4 --- modules/libjar/zipstruct.h 2001/02/16 23:43:03 *************** *** 32,38 **** * */ ! typedef struct ZipLocal_ { unsigned char signature [4]; unsigned char word [2]; --- 32,38 ---- * */ ! struct ZipLocal_ { unsigned char signature [4]; unsigned char word [2]; *************** typedef struct ZipLocal_ *** 45,53 **** unsigned char orglen [4]; unsigned char filename_len [2]; unsigned char extrafield_len [2]; ! } ZipLocal; ! typedef struct ZipCentral_ { unsigned char signature [4]; unsigned char version_made_by [2]; --- 45,54 ---- unsigned char orglen [4]; unsigned char filename_len [2]; unsigned char extrafield_len [2]; ! } __attribute__ ((packed)); ! typedef struct ZipLocal_ ZipLocal; ! struct ZipCentral_ { unsigned char signature [4]; unsigned char version_made_by [2]; *************** typedef struct ZipCentral_ *** 66,74 **** unsigned char internal_attributes [2]; unsigned char external_attributes [4]; unsigned char localhdr_offset [4]; ! } ZipCentral; ! typedef struct ZipEnd_ { unsigned char signature [4]; unsigned char disk_nr [2]; --- 67,76 ---- unsigned char internal_attributes [2]; unsigned char external_attributes [4]; unsigned char localhdr_offset [4]; ! } __attribute__((packed)); ! typedef struct ZipCentral_ ZipCentral; ! struct ZipEnd_ { unsigned char signature [4]; unsigned char disk_nr [2]; *************** typedef struct ZipEnd_ *** 78,84 **** unsigned char central_dir_size [4]; unsigned char offset_central_dir [4]; unsigned char commentfield_len [2]; ! } ZipEnd; /* signatures */ #define LOCALSIG 0x04034B50l --- 80,87 ---- unsigned char central_dir_size [4]; unsigned char offset_central_dir [4]; unsigned char commentfield_len [2]; ! } __attribute__ ((packed)); ! typedef struct ZipEnd_ ZipEnd; /* signatures */ #define LOCALSIG 0x04034B50l Index: xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp =================================================================== RCS file: /cvsroot/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp,v retrieving revision 1.4 diff -p -p -r1.4 xptcstubs_arm.cpp *** xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp 2000/04/24 15:42:15 1.4 --- xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp 2001/02/16 23:44:02 *************** *** 30,35 **** --- 30,39 ---- static nsresult PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, PRUint32* args) + __asm__("PrepareAndDispatch") __attribute__((unused)); + + static nsresult + PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, PRUint32* args) { #define PARAM_BUFFER_COUNT 16 *************** PrepareAndDispatch(nsXPTCStubBase* self, *** 101,174 **** return result; } - ! /* The easiest way to implement this is to do it as a c++ method. This means that ! * the compiler will same some registers to the stack as soon as this method is ! * entered. We have to be aware of that and have to know the number of registers ! * that will be pushed to the stack for now. ! * The compiler passes arguments to functions/methods in r1-r3 and the rest is on the ! * stack. r0 is (self). ! * ! * ! * !!! IMPORTANT !!! ! * This code will *not* work if compiled without optimization (-O / -O2) because ! * the compiler overwrites the registers r0-r3 (it thinks it's called without ! * parameters) and perhaps reserves more stack space than we think. ! * ! * ! * Since we don't know the number of parameters we have to pass to the required ! * method we use the following scheme: ! * 1.) Save method parameters that are passed in r1-r3 to a secure location ! * 2.) copy the stack space that is reserved at method entry to a secure location ! * 3.) copy the method arguments that formerly where in r1-r3 right in front of the ! * other arguments (if any). PrepareAndDispatch needs all arguments in an array. ! * It will sort out the correct argument passing convention using the InterfaceInfo's. ! * 4.) Call PrepareAndDispatch ! * 5.) Copy the stack contents from our method entry back in place to exit cleanly. ! * ! * The easier way would be to completly implement this in assembler. This way one could get rid ! * of the compiler generated function prologue. */ ! #define STUB_ENTRY(n) \ ! nsresult nsXPTCStubBase::Stub##n() \ ! { \ ! register nsresult result; \ ! __asm__ __volatile__( \ ! "sub sp, sp, #32 \n\t" /* correct stack for pushing all args */ \ ! "str r1, [sp] \n\t" /* push all args in r1-r3 to stack */ \ ! "str r2, [sp, #4] \n\t" /* */ \ ! "str r3, [sp, #8] \n\t" /* */ \ ! "add r1, sp, #32 \n\t" /* copy saved registers: */ \ ! "ldr r2, [r1] \n\t" /* The scene is as follows - */ \ ! "str r2, [sp, #12] \n\t" /* sl, fp, ip, lr, pc get saved to the */ \ ! "ldr r2, [r1, # 4] \n\t" /* stack, and behind that is the rest */ \ ! "str r2, [sp, #16] \n\t" /* of our function parameters. */ \ ! "ldr r2, [r1, # 8] \n\t" /* */ \ ! "str r2, [sp, #20] \n\t" /* */ \ ! "ldr r2, [r1, #12] \n\t" \ ! "str r2, [sp, #24] \n\t" \ ! "ldr r2, [r1, #16] \n\t" \ ! "str r2, [sp, #28] \n\t" \ ! "ldmia sp, {r1, r2, r3}\n\t" /* Copy method arguments to the right */ \ ! "add lr, sp, #40 \n\t" /* location. */ \ ! "stmia lr, {r1, r2, r3}\n\t" \ ! "add sp, sp, #12 \n\t" \ ! "mov r1, #"#n" \n\t" /* = methodIndex */ \ ! "mov r2, lr \n\t" /* = &(args) */ \ ! "bl PrepareAndDispatch__FP14nsXPTCStubBaseUiPUi \n\t" /*PrepareAndDispatch*/ \ ! "mov %0, r0 \n\t" /* Result */ \ ! "add r0, sp, #20 \n\t" /* copy everything back in place for */ \ ! "ldmia sp!, {r1,r2,r3} \n\t" /* the normal c++ m,ethod exit */ \ ! "stmia r0!, {r1,r2,r3} \n\t" \ ! "ldmia sp!, {r1, r2} \n\t" \ ! "stmia r0, {r1, r2} \n\t" \ ! : "=r" (result) \ ! : \ ! : "r0", "r1", "r2", "r3", "lr" ); \ ! return result; \ ! } #define SENTINEL_ENTRY(n) \ nsresult nsXPTCStubBase::Sentinel##n() \ --- 105,144 ---- return result; } ! /* ! * SharedStub() ! * Collects arguments and calls PrepareAndDispatch. The "methodIndex" is ! * passed to this function vi r12(ip) to preserve the argument registers. */ + __asm__( + "### SharedStub ####\n" + ".text\n\t" + ".align 0\n\t" + "SharedStub:\n\t" + "stmfd\tsp!, {r1, r2, r3}\n\t" /* Save extra arguments on stack */ + "mov\tr1, ip\n\t" /* Pass methodIndex */ + "mov\tr2, sp\n\t" /* Pass args */ + "stmfd\tsp!, {lr}\n\t" + "bl\tPrepareAndDispatch\n\t" + "ldmfd\tsp!, {lr}\n\t" + "add\tsp, sp, #12\n\t" + "mov\tpc, lr\n" + ); ! /* nsresult nsXPTCStubBase::Stub##n() ! * Sets register r12(ip) to methodIndex and jumps to SharedStub. ! */ ! #define STUB_ENTRY(n) \ ! __asm__( \ ! "@### Stub"#n" ####\n" \ ! ".text\n\t" \ ! ".align 0\n\t" \ ! ".global Stub"#n"__14nsXPTCStubBase\n" \ ! "Stub"#n"__14nsXPTCStubBase:\n\t" \ ! "mov\tip, #"#n"\n\t" \ ! "b\tSharedStub\n" \ ! ); #define SENTINEL_ENTRY(n) \ nsresult nsXPTCStubBase::Sentinel##n() \