update for HEAD-2003021201
[reactos.git] / drivers / net / npf / 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 #ifdef _USE_SW_FUNCS_
26
27 int32 SW_LONG_AT(void *b, uint32 c)
28 {
29         return  ((int32)*((uint8 *)b+c)<<24|
30                  (int32)*((uint8 *)b+c+1)<<16|
31                  (int32)*((uint8 *)b+c+2)<<8|
32                  (int32)*((uint8 *)b+c+3)<<0);
33 }
34
35 uint32 SW_ULONG_AT(void *b, uint32 c)
36 {
37         return  ((uint32)*((uint8 *)b+c)<<24|
38                  (uint32)*((uint8 *)b+c+1)<<16|
39                  (uint32)*((uint8 *)b+c+2)<<8|
40                  (uint32)*((uint8 *)b+c+3)<<0);
41 }
42
43 int16 SW_SHORT_AT(void *b, uint32 os)
44 {
45         return ((int16)
46                 ((int16)*((uint8 *)b+os+0)<<8|
47                  (int16)*((uint8 *)b+os+1)<<0));
48 }
49
50 uint16 SW_USHORT_AT(void *b, uint32 os)
51 {
52         return ((uint16)
53                 ((uint16)*((uint8 *)b+os+0)<<8|
54                  (uint16)*((uint8 *)b+os+1)<<0));
55 }
56
57 VOID SW_ULONG_ASSIGN(void *dst, uint32 src)
58 {
59         *((uint8*)dst+0)=*((uint8*)&src+3);
60         *((uint8*)dst+1)=*((uint8*)&src+2);
61         *((uint8*)dst+2)=*((uint8*)&src+1);
62         *((uint8*)dst+3)=*((uint8*)&src+0);
63
64 }
65
66 #endif /*_USE_SW_FUNCS_*/
67
68 void assert(void* assert, const char* file, int line, void* msg) { };