diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/buflib.c | 17 | ||||
-rw-r--r-- | firmware/common/dircache.c | 2 | ||||
-rw-r--r-- | firmware/common/unicode.c | 8 | ||||
-rw-r--r-- | firmware/common/zip.c | 2 | ||||
-rw-r--r-- | firmware/core_alloc.c | 20 | ||||
-rw-r--r-- | firmware/font.c | 2 | ||||
-rw-r--r-- | firmware/include/buflib.h | 23 | ||||
-rw-r--r-- | firmware/include/core_alloc.h | 7 | ||||
-rw-r--r-- | firmware/linuxboot.c | 4 | ||||
-rw-r--r-- | firmware/rolo.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/ata-nand-telechips.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c | 2 | ||||
-rw-r--r-- | firmware/target/mips/ingenic_x1000/installer-x1000.c | 2 | ||||
-rw-r--r-- | firmware/usbstack/usb_storage.c | 3 |
14 files changed, 32 insertions, 64 deletions
diff --git a/firmware/buflib.c b/firmware/buflib.c index ea57dbb379..8fc32f7406 100644 --- a/firmware/buflib.c +++ b/firmware/buflib.c | |||
@@ -633,7 +633,7 @@ buflib_buffer_in(struct buflib_context *ctx, int size) | |||
633 | int | 633 | int |
634 | buflib_alloc(struct buflib_context *ctx, size_t size) | 634 | buflib_alloc(struct buflib_context *ctx, size_t size) |
635 | { | 635 | { |
636 | return buflib_alloc_ex(ctx, size, NULL, NULL); | 636 | return buflib_alloc_ex(ctx, size, NULL); |
637 | } | 637 | } |
638 | 638 | ||
639 | /* Allocate a buffer of size bytes, returning a handle for it. | 639 | /* Allocate a buffer of size bytes, returning a handle for it. |
@@ -647,11 +647,9 @@ buflib_alloc(struct buflib_context *ctx, size_t size) | |||
647 | */ | 647 | */ |
648 | 648 | ||
649 | int | 649 | int |
650 | buflib_alloc_ex(struct buflib_context *ctx, size_t size, const char *name, | 650 | buflib_alloc_ex(struct buflib_context *ctx, size_t size, |
651 | struct buflib_callbacks *ops) | 651 | struct buflib_callbacks *ops) |
652 | { | 652 | { |
653 | (void)name; | ||
654 | |||
655 | union buflib_data *handle, *block; | 653 | union buflib_data *handle, *block; |
656 | bool last; | 654 | bool last; |
657 | /* This really is assigned a value before use */ | 655 | /* This really is assigned a value before use */ |
@@ -943,7 +941,7 @@ buflib_available(struct buflib_context* ctx) | |||
943 | * serviced anyway). | 941 | * serviced anyway). |
944 | */ | 942 | */ |
945 | int | 943 | int |
946 | buflib_alloc_maximum(struct buflib_context* ctx, const char* name, size_t *size, struct buflib_callbacks *ops) | 944 | buflib_alloc_maximum(struct buflib_context* ctx, size_t *size, struct buflib_callbacks *ops) |
947 | { | 945 | { |
948 | /* ignore ctx->compact because it's true if all movable blocks are contiguous | 946 | /* ignore ctx->compact because it's true if all movable blocks are contiguous |
949 | * even if the buffer has holes due to unmovable allocations */ | 947 | * even if the buffer has holes due to unmovable allocations */ |
@@ -960,7 +958,7 @@ buflib_alloc_maximum(struct buflib_context* ctx, const char* name, size_t *size, | |||
960 | if (*size <= 0) /* OOM */ | 958 | if (*size <= 0) /* OOM */ |
961 | return -1; | 959 | return -1; |
962 | 960 | ||
963 | return buflib_alloc_ex(ctx, *size, name, ops); | 961 | return buflib_alloc_ex(ctx, *size, ops); |
964 | } | 962 | } |
965 | 963 | ||
966 | /* Shrink the allocation indicated by the handle according to new_start and | 964 | /* Shrink the allocation indicated by the handle according to new_start and |
@@ -1073,13 +1071,6 @@ unsigned buflib_pin_count(struct buflib_context *ctx, int handle) | |||
1073 | return data[-bidx_PIN].pincount; | 1071 | return data[-bidx_PIN].pincount; |
1074 | } | 1072 | } |
1075 | 1073 | ||
1076 | const char* buflib_get_name(struct buflib_context *ctx, int handle) | ||
1077 | { | ||
1078 | (void)ctx; | ||
1079 | (void)handle; | ||
1080 | return ""; | ||
1081 | } | ||
1082 | |||
1083 | #ifdef DEBUG | 1074 | #ifdef DEBUG |
1084 | 1075 | ||
1085 | void *buflib_get_data(struct buflib_context *ctx, int handle) | 1076 | void *buflib_get_data(struct buflib_context *ctx, int handle) |
diff --git a/firmware/common/dircache.c b/firmware/common/dircache.c index 5902f8b3fd..41564194d0 100644 --- a/firmware/common/dircache.c +++ b/firmware/common/dircache.c | |||
@@ -479,7 +479,7 @@ static void binding_dissolve_volume(struct dircache_runinfo_volume *dcrivolp) | |||
479 | static int alloc_cache(size_t size) | 479 | static int alloc_cache(size_t size) |
480 | { | 480 | { |
481 | /* pad with one extra-- see alloc_name() and free_name() */ | 481 | /* pad with one extra-- see alloc_name() and free_name() */ |
482 | return core_alloc_ex("dircache", size + 1, &dircache_runinfo.ops); | 482 | return core_alloc_ex(size + 1, &dircache_runinfo.ops); |
483 | } | 483 | } |
484 | 484 | ||
485 | /** | 485 | /** |
diff --git a/firmware/common/unicode.c b/firmware/common/unicode.c index e53ad6bcb0..1ed2e5e49d 100644 --- a/firmware/common/unicode.c +++ b/firmware/common/unicode.c | |||
@@ -166,15 +166,15 @@ static unsigned short default_cp_table_buf[MAX_CP_TABLE_SIZE+1]; | |||
166 | default_cp_table_buf | 166 | default_cp_table_buf |
167 | #define cp_table_free(handle) \ | 167 | #define cp_table_free(handle) \ |
168 | do {} while (0) | 168 | do {} while (0) |
169 | #define cp_table_alloc(filename, size, opsp) \ | 169 | #define cp_table_alloc(size, opsp) \ |
170 | ({ (void)(opsp); 1; }) | 170 | ({ (void)(opsp); 1; }) |
171 | #define cp_table_pin(handle) \ | 171 | #define cp_table_pin(handle) \ |
172 | do { (void)handle; } while(0) | 172 | do { (void)handle; } while(0) |
173 | #define cp_table_unpin(handle) \ | 173 | #define cp_table_unpin(handle) \ |
174 | do { (void)handle; } while(0) | 174 | do { (void)handle; } while(0) |
175 | #else | 175 | #else |
176 | #define cp_table_alloc(filename, size, opsp) \ | 176 | #define cp_table_alloc(size, opsp) \ |
177 | core_alloc_ex((filename), (size), (opsp)) | 177 | core_alloc_ex((size), (opsp)) |
178 | #define cp_table_free(handle) \ | 178 | #define cp_table_free(handle) \ |
179 | core_free(handle) | 179 | core_free(handle) |
180 | #define cp_table_get_data(handle) \ | 180 | #define cp_table_get_data(handle) \ |
@@ -223,7 +223,7 @@ static int alloc_and_load_cp_table(int cp, void *buf) | |||
223 | !(size % (off_t)sizeof (uint16_t))) { | 223 | !(size % (off_t)sizeof (uint16_t))) { |
224 | 224 | ||
225 | /* if the buffer is provided, use that but don't alloc */ | 225 | /* if the buffer is provided, use that but don't alloc */ |
226 | int handle = buf ? 0 : cp_table_alloc(filename, size, NULL); | 226 | int handle = buf ? 0 : cp_table_alloc(size, NULL); |
227 | if (handle > 0) { | 227 | if (handle > 0) { |
228 | cp_table_pin(handle); | 228 | cp_table_pin(handle); |
229 | buf = cp_table_get_data(handle); | 229 | buf = cp_table_get_data(handle); |
diff --git a/firmware/common/zip.c b/firmware/common/zip.c index 6d250abb58..2d560e472e 100644 --- a/firmware/common/zip.c +++ b/firmware/common/zip.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include "crc32.h" | 31 | #include "crc32.h" |
32 | #include "rbendian.h" | 32 | #include "rbendian.h" |
33 | 33 | ||
34 | #define zip_core_alloc(N) core_alloc_ex("zip",(N),&buflib_ops_locked) | 34 | #define zip_core_alloc(N) core_alloc_ex((N),&buflib_ops_locked) |
35 | 35 | ||
36 | enum { | 36 | enum { |
37 | ZIP_SIG_ED = 0x06054b50, | 37 | ZIP_SIG_ED = 0x06054b50, |
diff --git a/firmware/core_alloc.c b/firmware/core_alloc.c index 0374c801c1..f5cc7f3189 100644 --- a/firmware/core_alloc.c +++ b/firmware/core_alloc.c | |||
@@ -51,7 +51,7 @@ void core_allocator_init(void) | |||
51 | 51 | ||
52 | buflib_init(&core_ctx, start, audiobufend - start); | 52 | buflib_init(&core_ctx, start, audiobufend - start); |
53 | 53 | ||
54 | test_alloc = core_alloc("test", 112); | 54 | test_alloc = core_alloc(112); |
55 | } | 55 | } |
56 | 56 | ||
57 | bool core_test_free(void) | 57 | bool core_test_free(void) |
@@ -69,14 +69,14 @@ bool core_test_free(void) | |||
69 | * Note: Buffers allocated by this functions are movable. | 69 | * Note: Buffers allocated by this functions are movable. |
70 | * Don't pass them to functions that call yield() | 70 | * Don't pass them to functions that call yield() |
71 | * like disc input/output. */ | 71 | * like disc input/output. */ |
72 | int core_alloc(const char* name, size_t size) | 72 | int core_alloc(size_t size) |
73 | { | 73 | { |
74 | return buflib_alloc_ex(&core_ctx, size, name, NULL); | 74 | return buflib_alloc_ex(&core_ctx, size, NULL); |
75 | } | 75 | } |
76 | 76 | ||
77 | int core_alloc_ex(const char* name, size_t size, struct buflib_callbacks *ops) | 77 | int core_alloc_ex(size_t size, struct buflib_callbacks *ops) |
78 | { | 78 | { |
79 | return buflib_alloc_ex(&core_ctx, size, name, ops); | 79 | return buflib_alloc_ex(&core_ctx, size, ops); |
80 | } | 80 | } |
81 | 81 | ||
82 | size_t core_available(void) | 82 | size_t core_available(void) |
@@ -94,9 +94,9 @@ int core_free(int handle) | |||
94 | return buflib_free(&core_ctx, handle); | 94 | return buflib_free(&core_ctx, handle); |
95 | } | 95 | } |
96 | 96 | ||
97 | int core_alloc_maximum(const char* name, size_t *size, struct buflib_callbacks *ops) | 97 | int core_alloc_maximum(size_t *size, struct buflib_callbacks *ops) |
98 | { | 98 | { |
99 | return buflib_alloc_maximum(&core_ctx, name, size, ops); | 99 | return buflib_alloc_maximum(&core_ctx, size, ops); |
100 | } | 100 | } |
101 | 101 | ||
102 | bool core_shrink(int handle, void* new_start, size_t new_size) | 102 | bool core_shrink(int handle, void* new_start, size_t new_size) |
@@ -119,12 +119,6 @@ unsigned core_pin_count(int handle) | |||
119 | return buflib_pin_count(&core_ctx, handle); | 119 | return buflib_pin_count(&core_ctx, handle); |
120 | } | 120 | } |
121 | 121 | ||
122 | const char* core_get_name(int handle) | ||
123 | { | ||
124 | const char *name = buflib_get_name(&core_ctx, handle); | ||
125 | return name ?: "<anonymous>"; | ||
126 | } | ||
127 | |||
128 | int core_get_num_blocks(void) | 122 | int core_get_num_blocks(void) |
129 | { | 123 | { |
130 | return buflib_get_num_blocks(&core_ctx); | 124 | return buflib_get_num_blocks(&core_ctx); |
diff --git a/firmware/font.c b/firmware/font.c index 8f0808ba87..2a2975cbf2 100644 --- a/firmware/font.c +++ b/firmware/font.c | |||
@@ -525,7 +525,7 @@ int font_load_ex( const char *path, size_t buf_size, int glyphs ) | |||
525 | font_id = open_slot; | 525 | font_id = open_slot; |
526 | 526 | ||
527 | /* allocate mem */ | 527 | /* allocate mem */ |
528 | int handle = core_alloc_ex( NULL, | 528 | int handle = core_alloc_ex( |
529 | bufsize + sizeof( struct buflib_alloc_data ), | 529 | bufsize + sizeof( struct buflib_alloc_data ), |
530 | &buflibops ); | 530 | &buflibops ); |
531 | if ( handle <= 0 ) | 531 | if ( handle <= 0 ) |
diff --git a/firmware/include/buflib.h b/firmware/include/buflib.h index d2231ab79d..e54ec72a99 100644 --- a/firmware/include/buflib.h +++ b/firmware/include/buflib.h | |||
@@ -62,8 +62,7 @@ struct buflib_context | |||
62 | * to the actually requested number of bytes. | 62 | * to the actually requested number of bytes. |
63 | * | 63 | * |
64 | * The total number of bytes consumed by an allocation is | 64 | * The total number of bytes consumed by an allocation is |
65 | * BUFLIB_ALLOC_OVERHEAD + requested bytes + strlen(<name passed to | 65 | * BUFLIB_ALLOC_OVERHEAD + requested bytes + pad to pointer size |
66 | * buflib_alloc_ex()) + pad to pointer size | ||
67 | */ | 66 | */ |
68 | #define BUFLIB_ALLOC_OVERHEAD (5*sizeof(union buflib_data)) | 67 | #define BUFLIB_ALLOC_OVERHEAD (5*sizeof(union buflib_data)) |
69 | 68 | ||
@@ -215,7 +214,6 @@ int buflib_alloc(struct buflib_context *context, size_t size); | |||
215 | * Allocates memory from the buflib's memory pool with additional callbacks | 214 | * Allocates memory from the buflib's memory pool with additional callbacks |
216 | * and flags | 215 | * and flags |
217 | * | 216 | * |
218 | * name: A string identifier giving this allocation a name | ||
219 | * size: How many bytes to allocate | 217 | * size: How many bytes to allocate |
220 | * ops: a struct with pointers to callback functions (see above). | 218 | * ops: a struct with pointers to callback functions (see above). |
221 | * if "ops" is NULL: Buffer is movable. | 219 | * if "ops" is NULL: Buffer is movable. |
@@ -223,7 +221,7 @@ int buflib_alloc(struct buflib_context *context, size_t size); | |||
223 | * Returns: A positive integer handle identifying this allocation, or | 221 | * Returns: A positive integer handle identifying this allocation, or |
224 | * a negative value on error (0 is also not a valid handle) | 222 | * a negative value on error (0 is also not a valid handle) |
225 | */ | 223 | */ |
226 | int buflib_alloc_ex(struct buflib_context *ctx, size_t size, const char *name, | 224 | int buflib_alloc_ex(struct buflib_context *ctx, size_t size, |
227 | struct buflib_callbacks *ops); | 225 | struct buflib_callbacks *ops); |
228 | 226 | ||
229 | 227 | ||
@@ -241,15 +239,14 @@ int buflib_alloc_ex(struct buflib_context *ctx, size_t size, const char *name, | |||
241 | * and even shrinks other allocations. However, do not depend on this behavior, | 239 | * and even shrinks other allocations. However, do not depend on this behavior, |
242 | * it may change. | 240 | * it may change. |
243 | * | 241 | * |
244 | * name: A string identifier giving this allocation a name | ||
245 | * size: The actual size will be returned into size | 242 | * size: The actual size will be returned into size |
246 | * ops: a struct with pointers to callback functions | 243 | * ops: a struct with pointers to callback functions |
247 | * | 244 | * |
248 | * Returns: A positive integer handle identifying this allocation, or | 245 | * Returns: A positive integer handle identifying this allocation, or |
249 | * a negative value on error (0 is also not a valid handle) | 246 | * a negative value on error (0 is also not a valid handle) |
250 | */ | 247 | */ |
251 | int buflib_alloc_maximum(struct buflib_context* ctx, const char* name, | 248 | int buflib_alloc_maximum(struct buflib_context* ctx, |
252 | size_t *size, struct buflib_callbacks *ops); | 249 | size_t *size, struct buflib_callbacks *ops); |
253 | 250 | ||
254 | /** | 251 | /** |
255 | * Queries the data pointer for the given handle. It's actually a cheap | 252 | * Queries the data pointer for the given handle. It's actually a cheap |
@@ -349,18 +346,6 @@ void buflib_buffer_in(struct buflib_context *ctx, int size); | |||
349 | /* debugging */ | 346 | /* debugging */ |
350 | 347 | ||
351 | /** | 348 | /** |
352 | * Returns the name, as given to buflib_alloc() and buflib_allloc_ex(), of the | ||
353 | * allocation associated with the given handle. As naming allocations | ||
354 | * is optional, there might be no name associated. | ||
355 | * | ||
356 | * handle: The handle indicating the allocation | ||
357 | * | ||
358 | * Returns: A pointer to the string identifier of the allocation, or NULL | ||
359 | * if none was specified with buflib_alloc_ex(). | ||
360 | */ | ||
361 | const char* buflib_get_name(struct buflib_context *ctx, int handle); | ||
362 | |||
363 | /** | ||
364 | * Gets the number of blocks in the entire buffer, allocated or unallocated | 349 | * Gets the number of blocks in the entire buffer, allocated or unallocated |
365 | * | 350 | * |
366 | * Only available if BUFLIB_DEBUG_BLOCK_SIGNLE is defined | 351 | * Only available if BUFLIB_DEBUG_BLOCK_SIGNLE is defined |
diff --git a/firmware/include/core_alloc.h b/firmware/include/core_alloc.h index 13d8165be2..8011c227b1 100644 --- a/firmware/include/core_alloc.h +++ b/firmware/include/core_alloc.h | |||
@@ -11,9 +11,9 @@ | |||
11 | * they have a predefined context | 11 | * they have a predefined context |
12 | */ | 12 | */ |
13 | void core_allocator_init(void) INIT_ATTR; | 13 | void core_allocator_init(void) INIT_ATTR; |
14 | int core_alloc(const char* name, size_t size); | 14 | int core_alloc(size_t size); |
15 | int core_alloc_ex(const char* name, size_t size, struct buflib_callbacks *ops); | 15 | int core_alloc_ex(size_t size, struct buflib_callbacks *ops); |
16 | int core_alloc_maximum(const char* name, size_t *size, struct buflib_callbacks *ops); | 16 | int core_alloc_maximum(size_t *size, struct buflib_callbacks *ops); |
17 | bool core_shrink(int handle, void* new_start, size_t new_size); | 17 | bool core_shrink(int handle, void* new_start, size_t new_size); |
18 | void core_pin(int handle); | 18 | void core_pin(int handle); |
19 | void core_unpin(int handle); | 19 | void core_unpin(int handle); |
@@ -21,7 +21,6 @@ unsigned core_pin_count(int handle); | |||
21 | int core_free(int handle); | 21 | int core_free(int handle); |
22 | size_t core_available(void); | 22 | size_t core_available(void); |
23 | size_t core_allocatable(void); | 23 | size_t core_allocatable(void); |
24 | const char* core_get_name(int handle); | ||
25 | #ifdef DEBUG | 24 | #ifdef DEBUG |
26 | void core_check_valid(void); | 25 | void core_check_valid(void); |
27 | #endif | 26 | #endif |
diff --git a/firmware/linuxboot.c b/firmware/linuxboot.c index 419044b5a9..74d87fbd64 100644 --- a/firmware/linuxboot.c +++ b/firmware/linuxboot.c | |||
@@ -80,7 +80,7 @@ static int uimage_alloc_state(const struct uimage_header* uh) | |||
80 | #ifdef HAVE_UIMAGE_COMP_GZIP | 80 | #ifdef HAVE_UIMAGE_COMP_GZIP |
81 | case IH_COMP_GZIP: | 81 | case IH_COMP_GZIP: |
82 | size = inflate_size + inflate_align - 1; | 82 | size = inflate_size + inflate_align - 1; |
83 | return core_alloc_ex("inflate", size, &buflib_ops_locked); | 83 | return core_alloc_ex(size, &buflib_ops_locked); |
84 | #endif | 84 | #endif |
85 | 85 | ||
86 | default: | 86 | default: |
@@ -206,7 +206,7 @@ int uimage_load(struct uimage_header* uh, size_t* out_size, | |||
206 | return E_OUT_OF_MEMORY; | 206 | return E_OUT_OF_MEMORY; |
207 | 207 | ||
208 | *out_size = 0; | 208 | *out_size = 0; |
209 | int out_h = core_alloc_maximum("uimage", out_size, &buflib_ops_locked); | 209 | int out_h = core_alloc_maximum(out_size, &buflib_ops_locked); |
210 | if(out_h <= 0) { | 210 | if(out_h <= 0) { |
211 | ret = E_OUT_OF_MEMORY; | 211 | ret = E_OUT_OF_MEMORY; |
212 | goto err; | 212 | goto err; |
diff --git a/firmware/rolo.c b/firmware/rolo.c index d280e39243..a3e6d5c2b9 100644 --- a/firmware/rolo.c +++ b/firmware/rolo.c | |||
@@ -239,7 +239,7 @@ int rolo_load(const char* filename) | |||
239 | 239 | ||
240 | /* get the system buffer. release only in case of error, otherwise | 240 | /* get the system buffer. release only in case of error, otherwise |
241 | * we don't return anyway */ | 241 | * we don't return anyway */ |
242 | rolo_handle = core_alloc_maximum("rolo", &filebuf_size, &buflib_ops_locked); | 242 | rolo_handle = core_alloc_maximum(&filebuf_size, &buflib_ops_locked); |
243 | if (rolo_handle < 0) | 243 | if (rolo_handle < 0) |
244 | { | 244 | { |
245 | rolo_error("OOM"); | 245 | rolo_error("OOM"); |
diff --git a/firmware/target/arm/ata-nand-telechips.c b/firmware/target/arm/ata-nand-telechips.c index 55f6b1f3f7..d61c223219 100644 --- a/firmware/target/arm/ata-nand-telechips.c +++ b/firmware/target/arm/ata-nand-telechips.c | |||
@@ -915,7 +915,7 @@ int nand_init(void) | |||
915 | #ifndef BOOTLOADER | 915 | #ifndef BOOTLOADER |
916 | /* Use chip info to allocate the correct size LPT buffer */ | 916 | /* Use chip info to allocate the correct size LPT buffer */ |
917 | lptbuf_size = sizeof(struct lpt_entry) * segments_per_bank * total_banks; | 917 | lptbuf_size = sizeof(struct lpt_entry) * segments_per_bank * total_banks; |
918 | lpt_handle = core_alloc("lpt lookup", lptbuf_size); | 918 | lpt_handle = core_alloc(lptbuf_size); |
919 | struct lpt_entry* lpt_lookup = core_get_data(lpt_handle); | 919 | struct lpt_entry* lpt_lookup = core_get_data(lpt_handle); |
920 | #else | 920 | #else |
921 | /* Use a static array in the bootloader */ | 921 | /* Use a static array in the bootloader */ |
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c index f13904628d..a1985472a0 100644 --- a/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c +++ b/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c | |||
@@ -303,7 +303,7 @@ static void cfs_init(void) | |||
303 | _ata_read_sectors(CFS_CLUSTER2CLUSTER(vfat_inodes_nr[1]), 1, §or); | 303 | _ata_read_sectors(CFS_CLUSTER2CLUSTER(vfat_inodes_nr[1]), 1, §or); |
304 | inode = (struct cfs_inode*)§or; | 304 | inode = (struct cfs_inode*)§or; |
305 | #ifndef BOOTLOADER | 305 | #ifndef BOOTLOADER |
306 | sectors_handle = core_alloc("ata sectors", VFAT_SECTOR_SIZE(inode->filesize)); | 306 | sectors_handle = core_alloc(VFAT_SECTOR_SIZE(inode->filesize)); |
307 | unsigned long *sectors = core_get_data(sectors_handle); | 307 | unsigned long *sectors = core_get_data(sectors_handle); |
308 | #else | 308 | #else |
309 | static unsigned long _sector[VFAT_SECTOR_SIZE(1024*1024*1024)]; /* 1GB guess */ | 309 | static unsigned long _sector[VFAT_SECTOR_SIZE(1024*1024*1024)]; /* 1GB guess */ |
diff --git a/firmware/target/mips/ingenic_x1000/installer-x1000.c b/firmware/target/mips/ingenic_x1000/installer-x1000.c index acc1d7b711..d2f9e4e5e0 100644 --- a/firmware/target/mips/ingenic_x1000/installer-x1000.c +++ b/firmware/target/mips/ingenic_x1000/installer-x1000.c | |||
@@ -151,7 +151,7 @@ static int updater_init(struct updater* u) | |||
151 | 151 | ||
152 | /* buf_len is a bit oversized here, but it's not really important */ | 152 | /* buf_len is a bit oversized here, but it's not really important */ |
153 | u->buf_len = u->img_len + sizeof(mtar_t) + 2*CACHEALIGN_SIZE; | 153 | u->buf_len = u->img_len + sizeof(mtar_t) + 2*CACHEALIGN_SIZE; |
154 | u->buf_hnd = core_alloc_ex("boot_image", u->buf_len, &buflib_ops_locked); | 154 | u->buf_hnd = core_alloc_ex(u->buf_len, &buflib_ops_locked); |
155 | if(u->buf_hnd < 0) { | 155 | if(u->buf_hnd < 0) { |
156 | rc = IERR_OUT_OF_MEMORY; | 156 | rc = IERR_OUT_OF_MEMORY; |
157 | goto error; | 157 | goto error; |
diff --git a/firmware/usbstack/usb_storage.c b/firmware/usbstack/usb_storage.c index 08b1f0b7e7..714af9d535 100644 --- a/firmware/usbstack/usb_storage.c +++ b/firmware/usbstack/usb_storage.c | |||
@@ -451,8 +451,7 @@ void usb_storage_init_connection(void) | |||
451 | unsigned char * buffer; | 451 | unsigned char * buffer; |
452 | 452 | ||
453 | // Add 31 to handle worst-case misalignment | 453 | // Add 31 to handle worst-case misalignment |
454 | usb_handle = core_alloc_ex("usb storage", | 454 | usb_handle = core_alloc_ex(ALLOCATE_BUFFER_SIZE + MAX_CBW_SIZE + 31, |
455 | ALLOCATE_BUFFER_SIZE + MAX_CBW_SIZE + 31, | ||
456 | &buflib_ops_locked); | 455 | &buflib_ops_locked); |
457 | if (usb_handle < 0) | 456 | if (usb_handle < 0) |
458 | panicf("%s(): OOM", __func__); | 457 | panicf("%s(): OOM", __func__); |