From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: Eric Blake <eblake@redhat.com>
Cc: Joel Schopp <jschopp@linux.vnet.ibm.com>,
qemu-devel@nongnu.org, Michael Tsirkin <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 7/9] asn1_input-visitor.diff
Date: Wed, 13 Mar 2013 17:20:50 -0400 [thread overview]
Message-ID: <5140EDB2.2090009@linux.vnet.ibm.com> (raw)
In-Reply-To: <5140E6D4.3010600@redhat.com>
On 03/13/2013 04:51 PM, Eric Blake wrote:
> On 03/12/2013 09:09 PM, Joel Schopp wrote:
>> Implement an input visitor for ASN.1 BER encoding.
>>
>> Cc: Michael Tsirkin <mst@redhat.com>
>> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
>> Signed-off-by: Joel Schopp <jschopp@linux.vnet.ibm.com>
>> ---
>> include/qapi/ber-input-visitor.h | 30 ++
>> qapi/Makefile.objs | 2 +-
>> qapi/ber-input-visitor.c | 1073 ++++++++++++++++++++++++++++++++++++++
>> 3 files changed, 1104 insertions(+), 1 deletion(-)
>> create mode 100644 include/qapi/ber-input-visitor.h
>> create mode 100644 qapi/ber-input-visitor.c
>>
>> diff --git a/include/qapi/ber-input-visitor.h b/include/qapi/ber-input-visitor.h
>> new file mode 100644
>> index 0000000..eaa3d0e
>> --- /dev/null
>> +++ b/include/qapi/ber-input-visitor.h
>> @@ -0,0 +1,30 @@
>> +/*
>> + * BER Input Visitor header
>> + *
>> + * Copyright IBM, Corp. 2011
> It's 2013
>
>
>> +static void ber_input_type_number(Visitor *v, double *obj, const char *name,
>> + Error **errp)
>> +{
>> + BERInputVisitor *aiv = to_biv(v);
>> + uint32_t ber_type_tag;
>> + uint8_t ber_type_flags;
>> + uint32_t len;
>> + bool is_indefinite;
>> + char buf[128], buf2[128];
>> + GDoubleIEEE754 num;
>> + struct ieee754_buffer number;
>> + size_t to_read;
>> +
>> + switch (number.first) {
>> + case 0x42:
>> + *obj = nan("NAN");
>> + break;
>> + case 0x41:
>> + case 0x40:
>> + num.mpn.sign = ((number.first & 0x1) != 0);
>> + num.mpn.biased_exponent = ~0;
>> + num.mpn.mantissa_low = 0;
>> + num.mpn.mantissa_high = 0;
>> + *obj = num.v_double;
> Is this really portable enough? In other words, do we really require
> that qemu only compiles on platforms where double is in IEEE format?
>
Good question. I don't know in what format the other platforms are,
though. I know it's used on i386, x86_64, ppc, ppc64. My guess is that
it would have to be a really exotic CPU to not use this standard.
I hope this applies to ARM in general...
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0067d/Cihgejjg.html
Regards,
Stefan
Stefan
next prev parent reply other threads:[~2013-03-13 21:21 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-13 3:09 [Qemu-devel] [PATCH 0/9 v2] Implement and test asn1 ber visitors Joel Schopp
2013-03-13 3:09 ` [Qemu-devel] [PATCH 1/9] qemu-file Joel Schopp
2013-03-13 3:09 ` [Qemu-devel] [PATCH 2/9] qapi_c_arrays.diff Joel Schopp
2013-03-13 12:08 ` Eric Blake
2013-03-13 3:09 ` [Qemu-devel] [PATCH 3/9] two new file wrappers Joel Schopp
2013-03-13 3:09 ` [Qemu-devel] [PATCH 4/9] qemu_qsb.diff Joel Schopp
2013-03-13 3:09 ` [Qemu-devel] [PATCH 5/9] qapi_sized_buffer Joel Schopp
2013-03-13 3:09 ` [Qemu-devel] [PATCH 6/9] asn1_output-visitor.diff Joel Schopp
2013-03-13 20:46 ` Eric Blake
2013-03-13 3:09 ` [Qemu-devel] [PATCH 7/9] asn1_input-visitor.diff Joel Schopp
2013-03-13 20:51 ` Eric Blake
2013-03-13 21:20 ` Stefan Berger [this message]
2013-03-14 1:22 ` Joel Schopp
2013-03-14 1:53 ` Stefan Berger
2013-03-13 3:09 ` [Qemu-devel] [PATCH 8/9] asn1_test_visitor_serialization.diff Joel Schopp
2013-03-13 3:09 ` [Qemu-devel] [PATCH 9/9] update_maintainers.diff Joel Schopp
2013-03-13 20:53 ` Eric Blake
-- strict thread matches above, loose matches on Subject: below --
2013-03-13 18:56 [Qemu-devel] [PATCH 0/9 v3] Implement and test asn1 ber visitors Joel Schopp
2013-03-13 18:56 ` [Qemu-devel] [PATCH 7/9] asn1_input-visitor.diff Joel Schopp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5140EDB2.2090009@linux.vnet.ibm.com \
--to=stefanb@linux.vnet.ibm.com \
--cc=eblake@redhat.com \
--cc=jschopp@linux.vnet.ibm.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).