[prev in list] [next in list] [prev in thread] [next in thread]
List: bochs-dev
Subject: [Bochs-developers] [PATCH] printf %ld, %lx, %lu
From: "Myles Watson" <mylesgw () gmail ! com>
Date: 2007-10-08 14:53:06
Message-ID: 01ad01c809ba$f0d5ce50$0b23040a () chimp
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Thanks for the feedback. Here is a patch against 2.3.5 that adds support
for %ld, %lx, and %lu.
Myles
[Attachment #5 (text/html)]
<html xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Thanks for the feedback. Here is a patch against 2.3.5 that
adds support for %ld, %lx, and %lu.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Myles<o:p></o:p></span></font></p>
</div>
</body>
</html>
["printf.patch" (application/octet-stream)]
--- rombios.c.orig 2007-10-08 08:17:59.000000000 -0600
+++ rombios.c 2007-10-08 08:44:57.000000000 -0600
@@ -1579,9 +1579,27 @@
}
else if (c == 'l') {
s++;
+ c = read_byte(get_CS(), s); /* is it ld,lx,lu? */
arg_ptr++; /* increment to next arg */
hibyte = read_word(arg_seg, arg_ptr);
- put_luint(action, ((Bit32u) hibyte << 16) | arg, format_width, 0);
+ if (format_width == 0)
+ format_width = 8;
+ if (c == 'd') {
+ if (arg & 0x8000)
+ put_luint(action, 0L-(((Bit32u) hibyte << 16) | arg), format_width-1, 1);
+ else
+ put_luint(action, ((Bit32u) hibyte << 16) | arg, format_width, 0);
+ }
+ else if (c == 'u') {
+ put_luint(action, ((Bit32u) hibyte << 16) | arg, format_width, 0);
+ }
+ else /* c == 'x' */
+ {
+ for (i=format_width-1; i>=0; i--) {
+ nibble = ((((Bit32u) hibyte <<16) | arg) >> (4 * i)) & 0x000f;
+ send (action, (nibble<=9)? (nibble+'0') : (nibble-10+'A'));
+ }
+ }
}
else if (c == 'd') {
if (arg & 0x8000)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
bochs-developers mailing list
bochs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bochs-developers
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic