:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / drivers / net / packet / memory_t.c
1 /*
2  * Copyright (c) 2001
3  *      Politecnico di Torino.  All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that: (1) source code distributions
7  * retain the above copyright notice and this paragraph in its entirety, (2)
8  * distributions including binary code include the above copyright notice and
9  * this paragraph in its entirety in the documentation or other materials
10  * provided with the distribution, and (3) all advertising materials mentioning
11  * features or use of this software display the following acknowledgement:
12  * ``This product includes software developed by the Politecnico
13  * di Torino, and its contributors.'' Neither the name of
14  * the University nor the names of its contributors may be used to endorse
15  * or promote products derived from this software without specific prior
16  * written permission.
17  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20  */
21
22 #include "tme.h"
23 #include "memory_t.h"
24
25
26 int32 SW_LONG_AT(void *b, uint32 c)
27 {
28         return  ((int32)*((uint8 *)b+c)<<24|
29                  (int32)*((uint8 *)b+c+1)<<16|
30                  (int32)*((uint8 *)b+c+2)<<8|
31                  (int32)*((uint8 *)b+c+3)<<0);
32 }
33
34 uint32 SW_ULONG_AT(void *b, uint32 c)
35 {
36         return  ((uint32)*((uint8 *)b+c)<<24|
37                  (uint32)*((uint8 *)b+c+1)<<16|
38                  (uint32)*((uint8 *)b+c+2)<<8|
39                  (uint32)*((uint8 *)b+c+3)<<0);
40 }
41
42 int16 SW_SHORT_AT(void *b, uint32 os)
43 {
44         return ((int16)
45                 ((int16)*((uint8 *)b+os+0)<<8|
46                  (int16)*((uint8 *)b+os+1)<<0));
47 }
48
49 uint16 SW_USHORT_AT(void *b, uint32 os)
50 {
51         return ((uint16)
52                 ((uint16)*((uint8 *)b+os+0)<<8|
53                  (uint16)*((uint8 *)b+os+1)<<0));
54 }
55
56 VOID SW_ULONG_ASSIGN(void *dst, uint32 src)
57 {
58         *((uint8*)dst+0)=*((uint8*)&src+3);
59         *((uint8*)dst+1)=*((uint8*)&src+2);
60         *((uint8*)dst+2)=*((uint8*)&src+1);
61         *((uint8*)dst+3)=*((uint8*)&src+0);
62
63 }
64
65 void assert(void* assert, const char* file, int line, void* msg) { };