Commit 290e5f83 authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by Cesanta Bot

Switch to TI compiler + UMM malloc for CC3200

Frees up ~19KB RAM:

Before:
  Code size: 210616
  RAM at startup: 48636 total, 34472 free
  RAM after sys init: 15024 free

After:
  Code size: 195784
  RAM at startup: 65096 total, 52980 free
  RAM after sys init: 34116 free

PUBLISHED_FROM=32a9cb8fb6d75cf428bc3548dd5684ce6e52c508
parent b535cb31
...@@ -10250,6 +10250,15 @@ int asprintf(char **strp, const char *fmt, ...) { ...@@ -10250,6 +10250,15 @@ int asprintf(char **strp, const char *fmt, ...) {
return len; return len;
} }
#if MG_TI_NO_HOST_INTERFACE
time_t HOSTtime() {
struct timeval tp;
gettimeofday(&tp, NULL);
return tp.tv_sec;
}
#endif
#endif /* __TI_COMPILER_VERSION__ */ #endif /* __TI_COMPILER_VERSION__ */
#ifndef __TI_COMPILER_VERSION__ #ifndef __TI_COMPILER_VERSION__
...@@ -10643,7 +10652,7 @@ void fs_slfs_set_new_file_size(const char *name, size_t size) { ...@@ -10643,7 +10652,7 @@ void fs_slfs_set_new_file_size(const char *name, size_t size) {
int set_errno(int e) { int set_errno(int e) {
errno = e; errno = e;
return -e; return (e == 0 ? 0 : -1);
} }
static int is_sl_fname(const char *fname) { static int is_sl_fname(const char *fname) {
...@@ -10685,7 +10694,11 @@ static int fd_type(int fd) { ...@@ -10685,7 +10694,11 @@ static int fd_type(int fd) {
return FD_INVALID; return FD_INVALID;
} }
#if MG_TI_NO_HOST_INTERFACE
int open(const char *pathname, unsigned flags, int mode) {
#else
int _open(const char *pathname, int flags, mode_t mode) { int _open(const char *pathname, int flags, mode_t mode) {
#endif
int fd = -1; int fd = -1;
pathname = drop_dir(pathname); pathname = drop_dir(pathname);
if (is_sl_fname(pathname)) { if (is_sl_fname(pathname)) {
...@@ -10731,7 +10744,11 @@ int _stat(const char *pathname, struct stat *st) { ...@@ -10731,7 +10744,11 @@ int _stat(const char *pathname, struct stat *st) {
return res; return res;
} }
#if MG_TI_NO_HOST_INTERFACE
int close(int fd) {
#else
int _close(int fd) { int _close(int fd) {
#endif
int r = -1; int r = -1;
switch (fd_type(fd)) { switch (fd_type(fd)) {
case FD_INVALID: case FD_INVALID:
...@@ -10755,7 +10772,11 @@ int _close(int fd) { ...@@ -10755,7 +10772,11 @@ int _close(int fd) {
return r; return r;
} }
#if MG_TI_NO_HOST_INTERFACE
off_t lseek(int fd, off_t offset, int whence) {
#else
off_t _lseek(int fd, off_t offset, int whence) { off_t _lseek(int fd, off_t offset, int whence) {
#endif
int r = -1; int r = -1;
switch (fd_type(fd)) { switch (fd_type(fd)) {
case FD_INVALID: case FD_INVALID:
...@@ -10809,7 +10830,11 @@ int _fstat(int fd, struct stat *s) { ...@@ -10809,7 +10830,11 @@ int _fstat(int fd, struct stat *s) {
return r; return r;
} }
#if MG_TI_NO_HOST_INTERFACE
int read(int fd, char *buf, unsigned count) {
#else
ssize_t _read(int fd, void *buf, size_t count) { ssize_t _read(int fd, void *buf, size_t count) {
#endif
int r = -1; int r = -1;
switch (fd_type(fd)) { switch (fd_type(fd)) {
case FD_INVALID: case FD_INVALID:
...@@ -10839,7 +10864,11 @@ ssize_t _read(int fd, void *buf, size_t count) { ...@@ -10839,7 +10864,11 @@ ssize_t _read(int fd, void *buf, size_t count) {
return r; return r;
} }
#if MG_TI_NO_HOST_INTERFACE
int write(int fd, const char *buf, unsigned count) {
#else
ssize_t _write(int fd, const void *buf, size_t count) { ssize_t _write(int fd, const void *buf, size_t count) {
#endif
int r = -1; int r = -1;
size_t i = 0; size_t i = 0;
switch (fd_type(fd)) { switch (fd_type(fd)) {
...@@ -10877,7 +10906,11 @@ ssize_t _write(int fd, const void *buf, size_t count) { ...@@ -10877,7 +10906,11 @@ ssize_t _write(int fd, const void *buf, size_t count) {
return r; return r;
} }
#if MG_TI_NO_HOST_INTERFACE
int rename(const char *from, const char *to) {
#else
int _rename(const char *from, const char *to) { int _rename(const char *from, const char *to) {
#endif
int r = -1; int r = -1;
from = drop_dir(from); from = drop_dir(from);
to = drop_dir(to); to = drop_dir(to);
...@@ -10899,7 +10932,11 @@ int _link(const char *from, const char *to) { ...@@ -10899,7 +10932,11 @@ int _link(const char *from, const char *to) {
return set_errno(ENOTSUP); return set_errno(ENOTSUP);
} }
#if MG_TI_NO_HOST_INTERFACE
int unlink(const char *filename) {
#else
int _unlink(const char *filename) { int _unlink(const char *filename) {
#endif
int r = -1; int r = -1;
filename = drop_dir(filename); filename = drop_dir(filename);
if (is_sl_fname(filename)) { if (is_sl_fname(filename)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment