12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- void _exit(int status) {
- uart_puts("-- clib exit called. hanging.\r\n");
- memcpy(FB, (uint32_t*)0x200000, 1920*1080*4);
-
- while (1) {
- uart_putc(uart_getc());
- }
- }
- void* _sbrk(int incr)
- {
- uart_puts("-- sbrk: ");
- printhex((uint32_t)heap_end);
- uart_puts(" ");
- printhex_signed(incr);
- uart_puts("\r\n");
-
- uint8_t* prev_heap_end;
- prev_heap_end = heap_end;
- heap_end += incr;
- return (void*)prev_heap_end;
- }
- void _kill() {
- uart_puts("-- clib kill called. not implemented.\r\n");
- }
- int _getpid() {
- uart_puts("-- clib getpid_r called. stubbed.\r\n");
- return 1;
- }
- int _isatty_r() {
- uart_puts("-- clib isatty_r called. stubbed.\r\n");
- return 1;
- }
- int _close() {
- uart_puts("-- clib close called. stubbed.\r\n");
- return 1;
- }
- int _fstat() {
- //uart_puts("-- clib fstat called. stubbed.\n");
- return 0;
- }
- int _fseek() {
- //uart_puts("-- clib fseek called. stubbed.\n");
- return 0;
- }
- int _lseek() {
- //uart_puts("-- clib lseek called. stubbed.\n");
- return 0;
- }
- int _read() {
- //uart_puts("-- clib read called. stubbed.\n");
- return 0;
- }
- size_t _write(int fildes, const void *buf, size_t nbytes) {
- //uart_puts("-- clib write called:\n");
- for (int i=0; i<nbytes; i++) {
- uart_putc(((char*)buf)[i]);
- }
- return nbytes;
- }
- int _fini() {
- uart_puts("-- clib _fini called. stubbed.\n");
- return 0;
- }
|