Define a few missing bit masks.

Rebased from pull request sent to mulicheng.