diff options
author | Marvin Borner | 2021-05-03 00:01:49 +0200 |
---|---|---|
committer | Marvin Borner | 2021-05-03 00:01:49 +0200 |
commit | 975dc11bbf2edfd7f30f98c17f593058368a30c0 (patch) | |
tree | b0a7cadce8edb943f535687785afd2880dbfcccb | |
parent | 7e55005dda411b5adafb985e485e3756969f6ac0 (diff) |
PURE
-rw-r--r-- | kernel/drivers/gdt.c | 2 | ||||
-rw-r--r-- | kernel/inc/gdt.h | 2 | ||||
-rw-r--r-- | libs/libc/inc/str.h | 20 |
3 files changed, 12 insertions, 12 deletions
diff --git a/kernel/drivers/gdt.c b/kernel/drivers/gdt.c index 693f25f..3e7da94 100644 --- a/kernel/drivers/gdt.c +++ b/kernel/drivers/gdt.c @@ -21,7 +21,7 @@ static struct tss_entry tss = { 0 }; PROTECTED static struct gdt_ptr gp = { 0 }; -CONST u8 gdt_offset(u8 gate) +u8 gdt_offset(u8 gate) { assert(gate && gate < COUNT(gdt)); return ((u32)&gdt[gate] - (u32)gdt) & 0xff; diff --git a/kernel/inc/gdt.h b/kernel/inc/gdt.h index 20261f3..9de0ad3 100644 --- a/kernel/inc/gdt.h +++ b/kernel/inc/gdt.h @@ -61,7 +61,7 @@ struct tss_entry { u16 iomap_base; } PACKED; -u8 gdt_offset(u8 gate); +CONST u8 gdt_offset(u8 gate); void gdt_install(u32 esp); void tss_set_stack(u32 ss, u32 esp); diff --git a/libs/libc/inc/str.h b/libs/libc/inc/str.h index 542e586..f024aaa 100644 --- a/libs/libc/inc/str.h +++ b/libs/libc/inc/str.h @@ -5,29 +5,29 @@ #include <def.h> -u32 strlen(const char *s) NONNULL; -u32 strnlen(const char *s, u32 max) NONNULL; +PURE u32 strlen(const char *s) NONNULL; +PURE u32 strnlen(const char *s, u32 max) NONNULL; u32 strlcpy(char *dst, const char *src, u32 size) NONNULL; -char *strchr(char *s, char c) NONNULL; -char *strrchr(char *s, char c) NONNULL; +PURE char *strchr(char *s, char c) NONNULL; +PURE char *strrchr(char *s, char c) NONNULL; u32 strlcat(char *dst, const char *src, u32 size) NONNULL; s32 strcmp(const char *s1, const char *s2) NONNULL; s32 strncmp(const char *s1, const char *s2, u32 n) NONNULL; char *strinv(char *s) NONNULL; -char *strdup(const char *s) NONNULL; +ATTR((malloc)) char *strdup(const char *s) NONNULL; #ifdef KERNEL -u32 strlen_user(const char *s) NONNULL; -u32 strnlen_user(const char *s, u32 max) NONNULL; +PURE u32 strlen_user(const char *s) NONNULL; +PURE u32 strnlen_user(const char *s, u32 max) NONNULL; u32 strlcpy_user(char *dst, const char *src, u32 size) NONNULL; -char *strchr_user(char *s, char c) NONNULL; -char *strrchr_user(char *s, char c) NONNULL; +PURE char *strchr_user(char *s, char c) NONNULL; +PURE char *strrchr_user(char *s, char c) NONNULL; u32 strlcat_user(char *dst, const char *src, u32 size) NONNULL; s32 strcmp_user(const char *s1, const char *s2) NONNULL; s32 strncmp_user(const char *s1, const char *s2, u32 n) NONNULL; char *strinv_user(char *s) NONNULL; -char *strdup_user(const char *s) NONNULL; +ATTR((malloc)) char *strdup_user(const char *s) NONNULL; #endif |