Index: kernel/arch/sparc64/include/arch/sun4v/cpu.h
===================================================================
--- kernel/arch/sparc64/include/arch/sun4v/cpu.h	(revision de388736e700e7530d044c95d0feafe2328f5300)
+++ kernel/arch/sparc64/include/arch/sun4v/cpu.h	(revision 31e15be68a47a029289a467b6b9f837763fe97c1)
@@ -54,5 +54,5 @@
 	uint64_t cpuids[MAX_CORE_STRANDS];
 	struct cpu *cpus[MAX_CORE_STRANDS];
-	atomic_t nrdy;
+	atomic_size_t nrdy;
 	SPINLOCK_DECLARE(proposed_nrdy_lock);
 } exec_unit_t;
Index: kernel/generic/include/atomic.h
===================================================================
--- kernel/generic/include/atomic.h	(revision de388736e700e7530d044c95d0feafe2328f5300)
+++ kernel/generic/include/atomic.h	(revision 31e15be68a47a029289a467b6b9f837763fe97c1)
@@ -40,13 +40,4 @@
 #include <stdatomic.h>
 
-// TODO: Remove.
-// Before <stdatomic.h> was available, there was only one atomic type
-// equivalent to atomic_size_t. This means that in some places, atomic_t can
-// be replaced with a more appropriate type (e.g. atomic_bool for flags or
-// a signed type for potentially signed values).
-// So atomic_t should be replaced with the most appropriate type on a case by
-// case basis, and after there are no more uses, remove this type.
-typedef atomic_size_t atomic_t;
-
 #define atomic_predec(val) \
 	(atomic_fetch_sub((val), 1) - 1)
Index: kernel/generic/include/cap/cap.h
===================================================================
--- kernel/generic/include/cap/cap.h	(revision de388736e700e7530d044c95d0feafe2328f5300)
+++ kernel/generic/include/cap/cap.h	(revision 31e15be68a47a029289a467b6b9f837763fe97c1)
@@ -80,5 +80,5 @@
 typedef struct kobject {
 	kobject_type_t type;
-	atomic_t refcnt;
+	atomic_size_t refcnt;
 
 	/** Mutex protecting caps_list */
Index: kernel/generic/include/cpu.h
===================================================================
--- kernel/generic/include/cpu.h	(revision de388736e700e7530d044c95d0feafe2328f5300)
+++ kernel/generic/include/cpu.h	(revision 31e15be68a47a029289a467b6b9f837763fe97c1)
@@ -58,5 +58,5 @@
 	context_t saved_context;
 
-	atomic_t nrdy;
+	atomic_size_t nrdy;
 	runq_t rq[RQ_COUNT];
 	volatile size_t needs_relink;
Index: kernel/generic/include/halt.h
===================================================================
--- kernel/generic/include/halt.h	(revision de388736e700e7530d044c95d0feafe2328f5300)
+++ kernel/generic/include/halt.h	(revision 31e15be68a47a029289a467b6b9f837763fe97c1)
@@ -38,5 +38,5 @@
 #include <atomic.h>
 
-extern atomic_t haltstate;
+extern atomic_bool haltstate;
 
 extern void halt(void) __attribute__((noreturn));
Index: kernel/generic/include/ipc/ipc.h
===================================================================
--- kernel/generic/include/ipc/ipc.h	(revision de388736e700e7530d044c95d0feafe2328f5300)
+++ kernel/generic/include/ipc/ipc.h	(revision 31e15be68a47a029289a467b6b9f837763fe97c1)
@@ -71,5 +71,5 @@
 	struct call *hangup_call;
 	ipc_phone_state_t state;
-	atomic_t active_calls;
+	atomic_size_t active_calls;
 	/** User-defined label */
 	sysarg_t label;
@@ -90,5 +90,5 @@
 	 * Number of answers the answerbox is expecting to eventually arrive.
 	 */
-	atomic_t active_calls;
+	atomic_size_t active_calls;
 
 	/** Phones connected to this answerbox. */
Index: kernel/generic/include/mm/slab.h
===================================================================
--- kernel/generic/include/mm/slab.h	(revision de388736e700e7530d044c95d0feafe2328f5300)
+++ kernel/generic/include/mm/slab.h	(revision 31e15be68a47a029289a467b6b9f837763fe97c1)
@@ -99,9 +99,9 @@
 
 	/* Statistics */
-	atomic_t allocated_slabs;
-	atomic_t allocated_objs;
-	atomic_t cached_objs;
+	atomic_size_t allocated_slabs;
+	atomic_size_t allocated_objs;
+	atomic_size_t cached_objs;
 	/** How many magazines in magazines list */
-	atomic_t magazine_counter;
+	atomic_size_t magazine_counter;
 
 	/* Slabs */
Index: kernel/generic/include/proc/scheduler.h
===================================================================
--- kernel/generic/include/proc/scheduler.h	(revision de388736e700e7530d044c95d0feafe2328f5300)
+++ kernel/generic/include/proc/scheduler.h	(revision 31e15be68a47a029289a467b6b9f837763fe97c1)
@@ -52,5 +52,5 @@
 } runq_t;
 
-extern atomic_t nrdy;
+extern atomic_size_t nrdy;
 extern void scheduler_init(void);
 
Index: kernel/generic/include/proc/task.h
===================================================================
--- kernel/generic/include/proc/task.h	(revision de388736e700e7530d044c95d0feafe2328f5300)
+++ kernel/generic/include/proc/task.h	(revision 31e15be68a47a029289a467b6b9f837763fe97c1)
@@ -87,7 +87,7 @@
 
 	/** Number of references (i.e. threads). */
-	atomic_t refcount;
+	atomic_size_t refcount;
 	/** Number of threads that haven't exited yet. */
-	atomic_t lifecount;
+	atomic_size_t lifecount;
 
 	/** Task permissions. */
Index: kernel/generic/src/lib/halt.c
===================================================================
--- kernel/generic/src/lib/halt.c	(revision de388736e700e7530d044c95d0feafe2328f5300)
+++ kernel/generic/src/lib/halt.c	(revision 31e15be68a47a029289a467b6b9f837763fe97c1)
@@ -36,4 +36,5 @@
  */
 
+#include <stdbool.h>
 #include <halt.h>
 #include <log.h>
@@ -44,5 +45,5 @@
 
 /** Halt flag */
-atomic_t haltstate = 0;
+atomic_bool haltstate = false;
 
 /** Halt wrapper
@@ -57,9 +58,9 @@
 
 	if (!atomic_load(&haltstate)) {
-		atomic_store(&haltstate, 1);
+		atomic_store(&haltstate, true);
 		rundebugger = true;
 	}
 #else
-	atomic_store(&haltstate, 1);
+	atomic_store(&haltstate, true);
 #endif
 
Index: kernel/generic/src/proc/scheduler.c
===================================================================
--- kernel/generic/src/proc/scheduler.c	(revision de388736e700e7530d044c95d0feafe2328f5300)
+++ kernel/generic/src/proc/scheduler.c	(revision 31e15be68a47a029289a467b6b9f837763fe97c1)
@@ -68,5 +68,5 @@
 static void scheduler_separated_stack(void);
 
-atomic_t nrdy;  /**< Number of ready threads in the system. */
+atomic_size_t nrdy;  /**< Number of ready threads in the system. */
 
 /** Carry out actions before new task runs. */
Index: kernel/test/atomic/atomic1.c
===================================================================
--- kernel/test/atomic/atomic1.c	(revision de388736e700e7530d044c95d0feafe2328f5300)
+++ kernel/test/atomic/atomic1.c	(revision 31e15be68a47a029289a467b6b9f837763fe97c1)
@@ -32,5 +32,5 @@
 const char *test_atomic1(void)
 {
-	atomic_t a;
+	atomic_int a;
 
 	atomic_store(&a, 10);
Index: kernel/test/mm/falloc2.c
===================================================================
--- kernel/test/mm/falloc2.c	(revision de388736e700e7530d044c95d0feafe2328f5300)
+++ kernel/test/mm/falloc2.c	(revision 31e15be68a47a029289a467b6b9f837763fe97c1)
@@ -43,6 +43,6 @@
 #define THREADS      8
 
-static atomic_t thread_cnt;
-static atomic_t thread_fail;
+static atomic_size_t thread_cnt;
+static atomic_size_t thread_fail;
 
 static void falloc(void *arg)
Index: kernel/test/synch/semaphore1.c
===================================================================
--- kernel/test/synch/semaphore1.c	(revision de388736e700e7530d044c95d0feafe2328f5300)
+++ kernel/test/synch/semaphore1.c	(revision 31e15be68a47a029289a467b6b9f837763fe97c1)
@@ -41,6 +41,6 @@
 
 static waitq_t can_start;
-static atomic_t items_produced;
-static atomic_t items_consumed;
+static atomic_size_t items_produced;
+static atomic_size_t items_consumed;
 
 static void producer(void *arg)
Index: kernel/test/thread/thread1.c
===================================================================
--- kernel/test/thread/thread1.c	(revision de388736e700e7530d044c95d0feafe2328f5300)
+++ kernel/test/thread/thread1.c	(revision 31e15be68a47a029289a467b6b9f837763fe97c1)
@@ -30,4 +30,5 @@
 #include <test.h>
 #include <atomic.h>
+#include <stdbool.h>
 #include <proc/thread.h>
 
@@ -36,6 +37,6 @@
 #define THREADS  5
 
-static atomic_t finish;
-static atomic_t threads_finished;
+static atomic_bool finish;
+static atomic_size_t threads_finished;
 
 static void threadtest(void *data)
@@ -55,5 +56,5 @@
 	size_t total = 0;
 
-	atomic_store(&finish, 1);
+	atomic_store(&finish, true);
 	atomic_store(&threads_finished, 0);
 
@@ -72,5 +73,5 @@
 	thread_sleep(10);
 
-	atomic_store(&finish, 0);
+	atomic_store(&finish, false);
 	while (atomic_load(&threads_finished) < total) {
 		TPRINTF("Threads left: %zu\n", total - atomic_load(&threads_finished));
