Add some macro and atomic functions