Mouse Orientation

Hello,
I’m developing an application using SDL 1.2
The application will run on a PXA270 based bored running Linux.
The input device will be a mouse.
Now, we are testing a few screens in order to decide which one will be
used in the final product.
The ones that are in in landscape mode work great. I got now a new one
that is in portrait mode, I was able set the the frame buffer resolution
to 480x640 (instead of 640x480) and I can handle all the graphics
rotation. However how do I rotate the mouse movements (actually changing
the x axis to y and vice versa)
Thanks
Aviv