platform.c (0588000eac9ba4178cebade437da3b28e8fad48f) | platform.c (70a6f46d7b0ec03653b9ab3f8063a9717a4a53ef) |
---|---|
1/* 2 * Persistent Storage - platform driver interface parts. 3 * 4 * Copyright (C) 2007-2008 Google, Inc. 5 * Copyright (C) 2010 Intel Corporation <tony.luck@intel.com> 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 147 unchanged lines hidden (view full) --- 156 157#ifdef CONFIG_PSTORE_CONSOLE 158static void pstore_console_write(struct console *con, const char *s, unsigned c) 159{ 160 const char *e = s + c; 161 162 while (s < e) { 163 unsigned long flags; | 1/* 2 * Persistent Storage - platform driver interface parts. 3 * 4 * Copyright (C) 2007-2008 Google, Inc. 5 * Copyright (C) 2010 Intel Corporation <tony.luck@intel.com> 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 147 unchanged lines hidden (view full) --- 156 157#ifdef CONFIG_PSTORE_CONSOLE 158static void pstore_console_write(struct console *con, const char *s, unsigned c) 159{ 160 const char *e = s + c; 161 162 while (s < e) { 163 unsigned long flags; |
164 u64 id; |
|
164 165 if (c > psinfo->bufsize) 166 c = psinfo->bufsize; 167 168 if (oops_in_progress) { 169 if (!spin_trylock_irqsave(&psinfo->buf_lock, flags)) 170 break; 171 } else { 172 spin_lock_irqsave(&psinfo->buf_lock, flags); 173 } 174 memcpy(psinfo->buf, s, c); | 165 166 if (c > psinfo->bufsize) 167 c = psinfo->bufsize; 168 169 if (oops_in_progress) { 170 if (!spin_trylock_irqsave(&psinfo->buf_lock, flags)) 171 break; 172 } else { 173 spin_lock_irqsave(&psinfo->buf_lock, flags); 174 } 175 memcpy(psinfo->buf, s, c); |
175 psinfo->write(PSTORE_TYPE_CONSOLE, 0, NULL, 0, c, psinfo); | 176 psinfo->write(PSTORE_TYPE_CONSOLE, 0, &id, 0, c, psinfo); |
176 spin_unlock_irqrestore(&psinfo->buf_lock, flags); 177 s += c; 178 c = e - s; 179 } 180} 181 182static struct console pstore_console = { 183 .name = "pstore", --- 131 unchanged lines hidden --- | 177 spin_unlock_irqrestore(&psinfo->buf_lock, flags); 178 s += c; 179 c = e - s; 180 } 181} 182 183static struct console pstore_console = { 184 .name = "pstore", --- 131 unchanged lines hidden --- |