Subversion Repositories HelenOS

Rev

Rev 2071 | Rev 2272 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2071 Rev 2125
Line 72... Line 72...
72
       
72
       
73
        for (j = 0; j < cnt%sizeof(unative_t); j++)
73
        for (j = 0; j < cnt%sizeof(unative_t); j++)
74
            ((uint8_t *)(((unative_t *) dst) + i))[j] = ((uint8_t *)(((unative_t *) src) + i))[j];
74
            ((uint8_t *)(((unative_t *) dst) + i))[j] = ((uint8_t *)(((unative_t *) src) + i))[j];
75
    }
75
    }
76
       
76
       
77
    return (char *)src;
77
    return (char *) src;
78
}
78
}
79
 
79
 
80
/** Fill block of memory
80
/** Fill block of memory
81
 *
81
 *
82
 * Fill cnt bytes at dst address with the value x.
82
 * Fill cnt bytes at dst address with the value x.
Line 90... Line 90...
90
void _memsetb(uintptr_t dst, size_t cnt, uint8_t x)
90
void _memsetb(uintptr_t dst, size_t cnt, uint8_t x)
91
{
91
{
92
    int i;
92
    int i;
93
    uint8_t *p = (uint8_t *) dst;
93
    uint8_t *p = (uint8_t *) dst;
94
   
94
   
95
    for(i=0; i<cnt; i++)
95
    for (i = 0; i < cnt; i++)
96
        p[i] = x;
96
        p[i] = x;
97
}
97
}
98
 
98
 
99
/** Fill block of memory
99
/** Fill block of memory
100
 *
100
 *
Line 109... Line 109...
109
void _memsetw(uintptr_t dst, size_t cnt, uint16_t x)
109
void _memsetw(uintptr_t dst, size_t cnt, uint16_t x)
110
{
110
{
111
    int i;
111
    int i;
112
    uint16_t *p = (uint16_t *) dst;
112
    uint16_t *p = (uint16_t *) dst;
113
   
113
   
114
    for(i=0; i<cnt; i++)
114
    for (i = 0; i < cnt; i++)
115
        p[i] = x;  
115
        p[i] = x;  
116
}
116
}
117
 
117
 
-
 
118
/** Copy string
-
 
119
 *
-
 
120
 * Copy string from src address to dst address.
-
 
121
 * The copying is done char-by-char until the null
-
 
122
 * character. The source and destination memory areas
-
 
123
 * cannot overlap.
-
 
124
 *
-
 
125
 * @param src Origin string to copy from.
-
 
126
 * @param dst Origin string to copy to.
-
 
127
 *
-
 
128
 */
-
 
129
char *strcpy(char *dest, const char *src)
-
 
130
{
-
 
131
    char *orig = dest;
-
 
132
   
-
 
133
    while ((*(dest++) = *(src++)));
-
 
134
    return orig;
-
 
135
}
-
 
136
 
118
/** @}
137
/** @}
119
 */
138
 */