Browse Source

Add const attribute to byte-swapping functions

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
687afdcdd9
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      src/arch/i386/include/bits/byteswap.h

+ 3
- 3
src/arch/i386/include/bits/byteswap.h View File

1
 #ifndef ETHERBOOT_BITS_BYTESWAP_H
1
 #ifndef ETHERBOOT_BITS_BYTESWAP_H
2
 #define ETHERBOOT_BITS_BYTESWAP_H
2
 #define ETHERBOOT_BITS_BYTESWAP_H
3
 
3
 
4
-static inline __attribute__ ((always_inline)) uint16_t
4
+static inline __attribute__ ((always_inline, const)) uint16_t
5
 __i386_bswap_16(uint16_t x)
5
 __i386_bswap_16(uint16_t x)
6
 {
6
 {
7
 	__asm__("xchgb %b0,%h0\n\t"
7
 	__asm__("xchgb %b0,%h0\n\t"
10
 	return x;
10
 	return x;
11
 }
11
 }
12
 
12
 
13
-static inline __attribute__ ((always_inline)) uint32_t
13
+static inline __attribute__ ((always_inline, const)) uint32_t
14
 __i386_bswap_32(uint32_t x)
14
 __i386_bswap_32(uint32_t x)
15
 {
15
 {
16
 	__asm__("xchgb %b0,%h0\n\t"
16
 	__asm__("xchgb %b0,%h0\n\t"
21
 	return x;
21
 	return x;
22
 }
22
 }
23
 
23
 
24
-static inline __attribute__ ((always_inline)) uint64_t
24
+static inline __attribute__ ((always_inline, const)) uint64_t
25
 __i386_bswap_64(uint64_t x)
25
 __i386_bswap_64(uint64_t x)
26
 {
26
 {
27
 	union {
27
 	union {

Loading…
Cancel
Save