EXCLUSIVE

Rick Ross has been hooked up to a machine that's taking over the function of his heart and lungs ... according to sources connected to the music mogul.

Rick is in a Miami area hospital getting treatment in the cardiac unit -- a strong sign he might have suffered a heart attack which manifested itself as respiratory issues early Thursday morning.

TMZ broke the story ... Rick was rushed to a hospital after a 911 caller reported he was unresponsive and "slobbing at the mouth."

We're told doctors have put him on something called ECMO, or extracorporeal membrane oxygenation. It's a technique used to oxygenate his blood outside of his body, before it's pumped back into his body.

It's essentially a form of life support, and a clear sign of how dire the situation is.