Rev 4343 | Rev 4346 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4343 | Rev 4344 | ||
|---|---|---|---|
| Line 49... | Line 49... | ||
| 49 | #include <atomic.h> |
49 | #include <atomic.h> |
| 50 | 50 | ||
| 51 | #define KLOG_SIZE PAGE_SIZE |
51 | #define KLOG_SIZE PAGE_SIZE |
| 52 | #define KLOG_LATENCY 8 |
52 | #define KLOG_LATENCY 8 |
| 53 | 53 | ||
| 54 | /**< Kernel log cyclic buffer */ |
54 | /** Kernel log cyclic buffer */ |
| 55 | static char klog[KLOG_SIZE] __attribute__ ((aligned (PAGE_SIZE))); |
55 | static char klog[KLOG_SIZE] __attribute__ ((aligned (PAGE_SIZE))); |
| 56 | 56 | ||
| 57 | /**< Kernel log initialized */ |
57 | /** Kernel log initialized */ |
| 58 | static bool klog_inited = false; |
58 | static bool klog_inited = false; |
| 59 | /**< First kernel log characters */ |
59 | /** First kernel log characters */ |
| 60 | static index_t klog_start = 0; |
60 | static index_t klog_start = 0; |
| 61 | /**< Number of valid kernel log characters */ |
61 | /** Number of valid kernel log characters */ |
| 62 | static size_t klog_len = 0; |
62 | static size_t klog_len = 0; |
| 63 | /**< Number of stored (not printed) kernel log characters */ |
63 | /** Number of stored (not printed) kernel log characters */ |
| 64 | static size_t klog_stored = 0; |
64 | static size_t klog_stored = 0; |
| 65 | /**< Number of stored kernel log characters for uspace */ |
65 | /** Number of stored kernel log characters for uspace */ |
| 66 | static size_t klog_uspace = 0; |
66 | static size_t klog_uspace = 0; |
| 67 | 67 | ||
| 68 | /**< Silent output */ |
68 | /** Silence output */ |
| 69 | static bool silent = false; |
69 | bool silent = false; |
| 70 | 70 | ||
| 71 | /**< Kernel log spinlock */ |
71 | /** Kernel log spinlock */ |
| 72 | SPINLOCK_INITIALIZE(klog_lock); |
72 | SPINLOCK_INITIALIZE(klog_lock); |
| 73 | 73 | ||
| 74 | /** Physical memory area used for klog buffer */ |
74 | /** Physical memory area used for klog buffer */ |
| 75 | static parea_t klog_parea; |
75 | static parea_t klog_parea; |
| 76 | 76 | ||
| Line 99... | Line 99... | ||
| 99 | * |
99 | * |
| 100 | * This is not a real IRQ, so we always decline. |
100 | * This is not a real IRQ, so we always decline. |
| 101 | * |
101 | * |
| 102 | * @return Always returns IRQ_DECLINE. |
102 | * @return Always returns IRQ_DECLINE. |
| 103 | */ |
103 | */ |
| 104 | static irq_ownership_t klog_claim(void *instance) |
104 | static irq_ownership_t klog_claim(irq_t *irq) |
| 105 | { |
105 | { |
| 106 | return IRQ_DECLINE; |
106 | return IRQ_DECLINE; |
| 107 | } |
107 | } |
| 108 | 108 | ||
| 109 | /** Standard input character device */ |
109 | /** Standard input character device */ |