He slammed his head against the wall
Figuratively: He reacted with anger or frustration.
("When the beast was cursed by the beast, so was Nachash cursed by the beast, in my mouth Selek spoke to her, and began to strike his head with a stone, saying, "All that I have labored for these seven years has come to this, and she has brought me a rod of iron." - At the beginning of Rava (Theodor-Albeck) Parashat At the beginning of Parashat 20)
Translation
Expression (Hebrew)
הֵטִיחַ אֶת רֹאשׁוֹ בַּכֹּתֶל, הֵטִיחַ רֹאשׁוֹ בַּקִּיר
Definition (Hebrew)
בְּהַשְׁאָלָה: הֵגִיב בְּכַעַס אוֹ בְּתִסְכּוּל.
("כְּשֵׁם שֶׁהַבְּהֵמָה אֲרוּרָה מִן הַחַיָּה שִׁבְעָה כָּךְ נָחָשׁ אָרוּר מִן הַבְּהֵמָה שִׁבְעָה, בְּפֶתִי רִמְשָׂהּ סֶלֶק אָמַר לֵהּ, הִתְחִיל מֵטִיחַ רֹאשׁוֹ בַּכֹּתֶל, אָמַר כָּל מָה שֶׁעָמַלְתִּי לָז' שָׁנִים בָּא זֶה וְהוֹשִׁיטָה לִי בְּקָנֶה אֶתְמְהָא"- בְּרֵאשִׁית רַבָּה (תֵּאוֹדוֹר-אַלְבֵּק) פָּרָשַׁת בְּרֵאשִׁית פָּרָשָׁה כ)