-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
565 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef _ASM_DIV64_H | ||
#define _ASM_DIV64_H | ||
|
||
#include <os/types.h> | ||
|
||
# define do_div(n,base) ({ \ | ||
uint32_t __base = (base); \ | ||
uint32_t __rem; \ | ||
__rem = ((uint64_t)(n)) % __base; \ | ||
(n) = ((uint64_t)(n)) / __base; \ | ||
__rem; \ | ||
}) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,6 @@ | |
typedef unsigned long __kernel_size_t; | ||
typedef long __kernel_ssize_t; | ||
|
||
typedef long __kernel_ptrdiff_t; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ifndef _OS_CTYPE_H | ||
#define _OS_CTYPE_H | ||
|
||
static inline int isdigit(char c) { | ||
return c >= '0' && c <= '9'; | ||
} | ||
|
||
static inline int isalnum(char c) { | ||
return c >= 'a' && c <= 'z' || (c >= 'A' && c <= 'Z'); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
#include <os/string.h> | ||
|
||
#ifndef __HAVE_ARCH_MEMSET | ||
void *memset(void *s, int c, size_t count) | ||
{ | ||
void *memset(void *s, int c, size_t count) { | ||
char *xs = s; | ||
|
||
while (count--) | ||
*xs++ = c; | ||
return s; | ||
} | ||
#endif | ||
|
||
#ifndef __HAVE_ARCH_STRNLEN | ||
__kernel_size_t strnlen(const char *s, __kernel_size_t count) { | ||
const char *sc; | ||
|
||
for (sc = s; count-- && *sc != '\0'; ++sc) | ||
/* nothing */; | ||
return sc - s; | ||
} | ||
#endif |
Oops, something went wrong.