Changeset 571cc2d in mainline for kernel/generic/src/log/log.c
- Timestamp:
- 2025-04-17T15:14:03Z (5 days ago)
- Branches:
- master
- Children:
- d5b37b6
- Parents:
- af77459
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2025-04-11 15:56:15)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2025-04-17 15:14:03)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/log/log.c
raf77459 r571cc2d 60 60 61 61 /** Cyclic buffer holding the data for kernel log */ 62 uint8_t log_buffer[LOG_LENGTH] __attribute__((aligned(PAGE_SIZE)));62 static uint8_t log_buffer[LOG_LENGTH] __attribute__((aligned(PAGE_SIZE))); 63 63 64 64 /** Kernel log initialized */ … … 66 66 67 67 /** Position in the cyclic buffer where the first log entry starts */ 68 s ize_t log_start = 0;68 static size_t log_start = 0; 69 69 70 70 /** Sum of length of all log entries currently stored in the cyclic buffer */ 71 s ize_t log_used = 0;71 static size_t log_used = 0; 72 72 73 73 /** Log spinlock */ 74 SPINLOCK_STATIC_INITIALIZE_NAME(log_lock, "log_lock");74 static IRQ_SPINLOCK_INITIALIZE(log_lock); 75 75 76 76 /** Overall count of logged messages, which may overflow as needed */ … … 152 152 { 153 153 console_lock(); 154 spinlock_lock(&log_lock);155 spinlock_lock(&kio_lock);154 irq_spinlock_lock(&log_lock, true); 155 irq_spinlock_lock(&kio_lock, true); 156 156 157 157 log_current_start = (log_start + log_used) % LOG_LENGTH; … … 180 180 181 181 kio_push_char('\n'); 182 spinlock_unlock(&kio_lock);183 spinlock_unlock(&log_lock);182 irq_spinlock_unlock(&kio_lock, true); 183 irq_spinlock_unlock(&log_lock, true); 184 184 185 185 /* This has to be called after we released the locks above */ … … 195 195 return; 196 196 197 spinlock_lock(&log_lock);197 irq_spinlock_lock(&log_lock, true); 198 198 if (next_for_uspace < log_used) 199 199 event_notify_0(EVENT_KLOG, true); 200 spinlock_unlock(&log_lock);200 irq_spinlock_unlock(&log_lock, true); 201 201 } 202 202 … … 307 307 rc = EOK; 308 308 309 spinlock_lock(&log_lock);309 irq_spinlock_lock(&log_lock, true); 310 310 311 311 while (next_for_uspace < log_used) { … … 337 337 } 338 338 339 spinlock_unlock(&log_lock);339 irq_spinlock_unlock(&log_lock, true); 340 340 341 341 if (rc != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.