Saving data for different custom posts

Since save_post gives you the post_id of the current post, you simply want to check what post_type it is by using get_post_type($post_id)

like:

add_action('save_post', 'save_details')

function save_details($post_id)
{
     $post_type = $_REQUEST['post_type'];

     if ('foo_post' == $post_type)
     {
          // save stuff for foo_post
     }
     elseif ('bar_post' == $post_type)
     {
          // save stuff for bar_post
     }
}

and so on…

get_post_type() codex page