Any person who is imprisoned or restrained of his liberty in the State of Alabama on any criminal charge or accusation or under any other pretense whatever, except persons committed or detained by virtue of process issued by a court of the United States or by a judge thereof in cases of which such courts have exclusive jurisdiction under the laws of the United States or have acquired exclusive jurisdiction by the commencement of actions in such courts, may prosecute a writ of habeas corpus according to the provisions of this chapter to inquire into the cause of such imprisonment or restraint.
Ala. Code § 15-21-1 (1975)