Mechanism of the water and carbon dioxide solubility in oxides and silicates and the role of O−