[sw] Move our memory operation functions into lib/base.

This change also introduces read_32() and write_32(), for doing
direct word manipulation without violating strict alising. These
functions will be useful for DIF implementations.

Signed-off-by: Miguel Young de la Sota <mcyoung@google.com>
diff --git a/sw/device/lib/base/meson.build b/sw/device/lib/base/meson.build
new file mode 100644
index 0000000..0beab29
--- /dev/null
+++ b/sw/device/lib/base/meson.build
@@ -0,0 +1,13 @@
+# Copyright lowRISC contributors.
+# Licensed under the Apache License, Version 2.0, see LICENSE for details.
+# SPDX-License-Identifier: Apache-2.0
+
+# Memory Operations library (sw_lib_mem)
+sw_lib_mem = declare_dependency(
+  link_with: static_library(
+    'mem_ot',
+    sources: ['memory.c'],
+    c_args: ['-fno-builtin'],
+  )
+)
+