void show_mem(void) { int i,free = 0,total = 0,reserved = 0; int shared = 0; printk("Mem-info:\n"); show_free_areas(); printk("Free swap: %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10)); i = high_memory >> PAGE_SHIFT; while (i-- > 0) { total++; if (PageReserved(mem_map+i)) reserved++; else if (!mem_map[i].count) free++; else shared += mem_map[i].count-1; } printk("%d pages of RAM\n",total); printk("%d free pages\n",free); printk("%d reserved pages\n",reserved); printk("%d pages shared\n",shared); show_buffers(); #ifdef CONFIG_NET show_net_buffers(); #endif }
void show_mem(void) { int i, free = 0, total = 0, reserved = 0; int shared = 0, cached = 0; printk("Mem-info:\n"); show_free_areas(); printk("Free swap: %6dkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); i = max_mapnr; while (i-- > 0) { total++; if (PageReserved(mem_map+i)) reserved++; else if (PageSwapCache(mem_map+i)) cached++; else if (!atomic_read(&mem_map[i].count)) free++; else shared += atomic_read(&mem_map[i].count) - 1; } printk("%d pages of RAM\n", total); printk("%d reserved pages\n", reserved); printk("%d pages shared\n", shared); printk("%d pages swap cached\n",cached); printk("%ld pages in page table cache\n",pgtable_cache_size); printk("%d free pages\n", free); show_buffers(); #ifdef CONFIG_NET show_net_buffers(); #endif }
void show_mem(void) { struct sysinfo si; int i,free = 0,total = 0,reserved = 0; int shared = 0; si_swapinfo(&si); printk("Mem-info:\n"); show_free_areas(); printk("Free swap: %6ldkB\n", si.freeswap >> 10); i = MAP_NR(high_memory); while (i-- > 0) { total++; if (PageReserved(mem_map+i)) reserved++; else if (!mem_map[i].count) free++; else shared += mem_map[i].count-1; } printk("%d pages of RAM\n",total); printk("%d free pages\n",free); printk("%d reserved pages\n",reserved); printk("%d pages shared\n",shared); show_buffers(); #ifdef CONFIG_INET show_net_buffers(); #endif }
static _INLINE_ void receive_chars(struct LEON_serial *info, struct pt_regs *regs, unsigned short rx) { struct tty_struct *tty = info->tty; unsigned char ch; /* * This do { } while() loop will get ALL chars out of Rx FIFO */ do { ch = leon->uartdata1; if(info->is_cons) { if(0 /* LEON does not report break */ & rx) { /* whee, break received */ status_handle(info, rx); return; } else if (ch == 0x10) { /* ^P */ show_state(); show_free_areas(); show_buffers(); show_net_buffers(); return; } else if (ch == 0x12) { /* ^R */ hard_reset_now(); return; } /* It is a 'keyboard interrupt' ;-) */ wake_up(&keypress_wait); } if(!tty) goto clear_and_exit; /* * Make sure that we do not overflow the buffer */ if (tty->flip.count >= TTY_FLIPBUF_SIZE) { queue_task_irq_off(&tty->flip.tqueue, &tq_timer); return; } if(rx & USTAT_PE) { *tty->flip.flag_buf_ptr++ = TTY_PARITY; status_handle(info, rx); } else if(rx & USTAT_OV) { *tty->flip.flag_buf_ptr++ = TTY_OVERRUN; status_handle(info, rx); } else if(rx & USTAT_FE) { *tty->flip.flag_buf_ptr++ = TTY_FRAME; status_handle(info, rx); } else { *tty->flip.flag_buf_ptr++ = 0; /* XXX */ } *tty->flip.char_buf_ptr++ = ch; tty->flip.count++; } while((rx = leon->uartstatus1) & USTAT_DR); queue_task_irq_off(&tty->flip.tqueue, &tq_timer); clear_and_exit: return; }