summaryrefslogtreecommitdiffstats
path: root/src/arch/loong64/include/bits/string.h
diff options
context:
space:
mode:
authorSimon Rettberg2023-04-04 15:12:41 +0200
committerSimon Rettberg2023-04-04 15:12:41 +0200
commit5ba496dce11d10198a0eae0c8440dccb256fbf32 (patch)
tree549903f1dab893870335a6e4767a4530444d2e83 /src/arch/loong64/include/bits/string.h
parent[vesafb] Map Unicode characters to CP437 if possible (diff)
parent[tls] Handle fragmented handshake records (diff)
downloadipxe-5ba496dce11d10198a0eae0c8440dccb256fbf32.tar.gz
ipxe-5ba496dce11d10198a0eae0c8440dccb256fbf32.tar.xz
ipxe-5ba496dce11d10198a0eae0c8440dccb256fbf32.zip
Merge branch 'master' into openslx
Diffstat (limited to 'src/arch/loong64/include/bits/string.h')
-rw-r--r--src/arch/loong64/include/bits/string.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/arch/loong64/include/bits/string.h b/src/arch/loong64/include/bits/string.h
new file mode 100644
index 000000000..f54e25806
--- /dev/null
+++ b/src/arch/loong64/include/bits/string.h
@@ -0,0 +1,61 @@
+#ifndef _BITS_STRING_H
+#define _BITS_STRING_H
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+/** @file
+ *
+ * String functions
+ *
+ */
+
+extern void loong64_bzero ( void *dest, size_t len );
+extern void loong64_memset ( void *dest, size_t len, int character );
+extern void loong64_memcpy ( void *dest, const void *src, size_t len );
+extern void loong64_memmove_forwards ( void *dest, const void *src, size_t len );
+extern void loong64_memmove_backwards ( void *dest, const void *src, size_t len );
+extern void loong64_memmove ( void *dest, const void *src, size_t len );
+
+/**
+ * Fill memory region
+ *
+ * @v dest Destination region
+ * @v character Fill character
+ * @v len Length
+ * @ret dest Destination region
+ */
+static inline __attribute__ (( always_inline )) void *
+memset ( void *dest, int character, size_t len ) {
+ loong64_memset ( dest, len, character );
+ return dest;
+}
+
+/**
+ * Copy memory region
+ *
+ * @v dest Destination region
+ * @v src Source region
+ * @v len Length
+ * @ret dest Destination region
+ */
+static inline __attribute__ (( always_inline )) void *
+memcpy ( void *dest, const void *src, size_t len ) {
+ loong64_memcpy ( dest, src, len );
+ return dest;
+}
+
+/**
+ * Copy (possibly overlapping) memory region
+ *
+ * @v dest Destination region
+ * @v src Source region
+ * @v len Length
+ * @ret dest Destination region
+ */
+static inline __attribute__ (( always_inline )) void *
+memmove ( void *dest, const void *src, size_t len ) {
+ loong64_memmove ( dest, src, len );
+ return dest;
+}
+
+#endif /* _BITS_STRING_H */