void aee_sram_fiq_save_bin(const char *msg, size_t len) { int i; char buf[20]; for (i = 0; i < len;) { snprintf(buf, sizeof(long)*2 + 2, FORMAT_LONG, *(long*)(msg + i)); sram_log_save(buf, sizeof(long)*2 + 1); i += sizeof(long); if (i % 32 == 0) sram_log_save("\n", 1); } }
void aee_sram_fiq_save_bin(const char *msg, size_t len) { int delay = 100; char bin_buffer[4]; struct ram_console_buffer *buffer = ram_console_buffer; if(FIQ_log_size + len > CONFIG_MTK_RAM_CONSOLE_SIZE) { return; } if(len > 0xffff) { return; } if(len%4 !=0) { len -= len%4; } if(!atomic_read(&rc_in_fiq)) { atomic_set(&rc_in_fiq, 1); } while ((delay > 0) && (spin_is_locked(&ram_console_lock))) { udelay(1); delay--; } // bin buffer flag 00ff bin_buffer[0] = 0x00; bin_buffer[1] = 0xff; // bin buffer size bin_buffer[2] = len/255; bin_buffer[3] = len%255; sram_log_save(bin_buffer, 4); sram_log_save(msg, len); FIQ_log_size = FIQ_log_size + len +4; buffer->bin_log_count += len; }
void ram_console_write(struct console *console, const char *s, unsigned int count) { unsigned long flags; if (atomic_read(&rc_in_fiq)) return; spin_lock_irqsave(&ram_console_lock, flags); sram_log_save(s, count); spin_unlock_irqrestore(&ram_console_lock, flags); }
void aee_sram_fiq_log(const char *msg) { unsigned int count = strlen(msg); int delay = 100; if (FIQ_log_size + count > ram_console_buffer_size) { return; } atomic_set(&rc_in_fiq, 1); while ((delay > 0) && (spin_is_locked(&ram_console_lock))) { udelay(1); delay--; } sram_log_save(msg, count); FIQ_log_size += count; }
void aee_sram_fiq_log(const char *msg) { unsigned int count = strlen(msg); int delay = 100; if(FIQ_log_size + count > CONFIG_MTK_RAM_CONSOLE_SIZE) { return; } if(!atomic_read(&rc_in_fiq)) { atomic_set(&rc_in_fiq, 1); } while ((delay > 0) && (spin_is_locked(&ram_console_lock))) { udelay(1); delay--; } sram_log_save(msg, count); FIQ_log_size += count; }