summaryrefslogtreecommitdiffstats
path: root/tapset/endian.stp
blob: ddcc254638a6f7d4bbedbad92a6201c1293909cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# set the default endianess for binary printf
# val:   0 - native (default)
#        1 - little endian
#        2 - big endian
function set_endian:long (val:long) %{
	_stp_endian = THIS->val;	
%}

function big_endian2:long (val:long) %{
	THIS->__retvalue = cpu_to_be16(THIS->val);
%}

function big_endian4:long (val:long) %{
	THIS->__retvalue = cpu_to_be32(THIS->val);
%}

function big_endian8:long (val:long) %{
	THIS->__retvalue = cpu_to_be64(THIS->val);
%}

function little_endian2:long (val:long) %{
	THIS->__retvalue = cpu_to_le16(THIS->val);
%}

function little_endian4:long (val:long) %{
	THIS->__retvalue = cpu_to_le32(THIS->val);
%}

function little_endian8:long (val:long) %{
	THIS->__retvalue = cpu_to_le64(THIS->val);
%}