# HG changeset patch # User Josef 'Jeff' Sipek # Date 1672871225 18000 # Wed Jan 04 17:27:05 2023 -0500 # Node ID 6bc701fb517f214de16312e7ba718e4b64f9566c # Parent 9ebe509dce7c8e784a4ada0525a936cc5347473d arch.h: add ARRAY_LEN Signed-off-by: Josef 'Jeff' Sipek diff --git a/arch.h b/arch.h --- a/arch.h +++ b/arch.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Josef 'Jeff' Sipek + * Copyright (c) 2022-2023 Josef 'Jeff' Sipek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -38,6 +38,8 @@ #ifndef _ASM #define STATIC_ASSERT(c) _Static_assert(c, #c) +#define ARRAY_LEN(x) (sizeof(x) / sizeof(x[0])) + #define mmregs ((volatile struct mmregs_layout * volatile) (void *) 0x0) #endif