FreeCalypso > hg > freecalypso-sw
annotate target-utils/libtiffs/basicfind.c @ 884:353daaa6014d
gsm-fw/gpf/conf/gsmcomp.c: increased max partition in the voice-only config
The code we got from TCS211 had the maximum prim pool partition size set to
900 bytes in the voice-only config (no FAX_AND_DATA, no GPRS) and to 1600 bytes
in every other config. As it turns out, this "minimized" config breaks when
the AT command interface is used with %CPI enabled, as the responsible code in
ATI does an ACI_MALLOC of 1012 bytes. TI may have considered this case to be
unsupported usage (perhaps they didn't care about the combination of a
voice-only PS with AT command control), but we do want this use case to work
without crashing. Solution: I made the largest prim pool the same as it is
with FAX_AND_DATA: 3 partitions of 1600 bytes.
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Sat, 27 Jun 2015 07:31:30 +0000 |
parents | 2900fe603f8a |
children |
rev | line source |
---|---|
101
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 #include <sys/types.h> |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 #include "types.h" |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 #include "struct.h" |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 #include "globals.h" |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 #include "macros.h" |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 extern char *index(); |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 static |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 find_named_child(start, seekname) |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
11 char *seekname; |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 { |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 int ino; |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 struct inode *irec; |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
16 for (ino = start; ino != 0xFFFF; ino = irec->sibling) { |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
17 irec = mpffs_active_index + ino; |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 if (!irec->type) |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
19 continue; |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
20 if (!strcmp(inode_to_dataptr(irec), seekname)) |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
21 return(ino); |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
22 } |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
23 return(0); |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
24 } |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
25 |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
26 mpffs_pathname_to_inode(pathname) |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
27 char *pathname; |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
28 { |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
29 int ino, stat; |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
30 struct inode *irec; |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
31 char *cur, *next; |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
32 |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
33 stat = mpffs_init(); |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
34 if (stat < 0) |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
35 return(stat); |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
36 cur = pathname; |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
37 if (*cur == '/') |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
38 cur++; |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
39 for (ino = mpffs_root_ino; cur; cur = next) { |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
40 if (!*cur) |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
41 break; |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
42 next = index(cur, '/'); |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
43 if (next == cur) { |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
44 printf("malformed pathname: multiple adjacent slashes\n"); |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
45 return(-1); |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
46 } |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
47 if (next) |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
48 *next++ = '\0'; |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
49 irec = mpffs_active_index + ino; |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
50 if (irec->type != OBJTYPE_DIR) { |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
51 printf("Error: non-terminal non-directory\n"); |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
52 if (next) |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
53 next[-1] = '/'; |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
54 return(-1); |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
55 } |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
56 ino = find_named_child(irec->descend, cur); |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
57 if (next) |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
58 next[-1] = '/'; |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
59 if (!ino) { |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
60 printf("Error: pathname component not found\n"); |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
61 return(-1); |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
62 } |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
63 } |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
64 return(ino); |
7029fe8ae0bc
pirexplore: FFS find command implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
65 } |