1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 18 unchanged lines hidden (view full) ---

27 *
28 * Authors: Nathan Binkert
29 * Ali Saidi
30 */
31
32#include <sys/types.h>
33#include <algorithm>
34
35#include "base/trace.hh"
35#include "arch/arguments.hh"
36#include "base/trace.hh"
37#include "kern/linux/printk.hh"
38
39using namespace std;
40
41
42void
42Printk(TheISA::Arguments args)
43Printk(stringstream &out, TheISA::Arguments args)
44{
44 std::ostream &out = Trace::output();
45 char *p = (char *)args++;
46
47 ios::fmtflags saved_flags = out.flags();
48 char old_fill = out.fill();
49 int old_precision = out.precision();
50
47 while (*p) {
48 switch (*p) {
49 case '%': {
50 bool more = true;
51 bool islong = false;
52 bool leftjustify = false;
53 bool format = false;
54 bool zero = false;

--- 194 unchanged lines hidden (view full) ---

249 default: {
250 size_t len = strcspn(p, "%\n\r\0");
251 out.write(p, len);
252 p += len;
253 }
254 }
255 }
256
261 out.flags(saved_flags);
262 out.fill(old_fill);
263 out.precision(old_precision);
257}
258